*/
/**
- * Battery ADC reading.
+ * Reads the ADC pin connected to the Davis Instruments anemometer. The
+ * connection is made via a resistor divider. The voltage seen by the ADC
+ * is related to VREF, the maximum voltage presented to the ADC.
+ * 0V or VREF means North
+ * VREF*1/4 means East
+ * VREF*2/4 means South
+ * VREF*3/4 means West
+ *
+ * We assume a 12-bit ADC, so VREF reads as 4095 and 0V reads as 0.
*
* @author R. Steve McKown <rsmckown@gmail.com>
*/
#include "Msp430Adc12.h"
-module BatteryAdcP {
+module WindVaneAdcP {
provides interface AdcConfigure<const msp430adc12_channel_config_t*>;
}
implementation {
* jumping around. The external reference of 2.50V seems stable.
*/
const msp430adc12_channel_config_t config = {
- inch: INPUT_CHANNEL_A0,
+ inch: INPUT_CHANNEL_A0, // A2
#if 0 /* internal references unstable */
sref: REFERENCE_VREFplus_AVss,
ref2_5v: REFVOLT_LEVEL_1_5, /* REFVOLT_LEVEL_2_5, */