X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=blobdiff_plain;f=tos%2Fplatforms%2Ftmirws%2Fsensors%2FWindVaneAdcP.nc;h=b4e920548f8fad9033361f9b099ee767a18b46eb;hp=a80362bad34021a7db41aea82dacd40b86718b44;hb=108ff439d63ddb1413efe5e9830392bab56e001b;hpb=0363ad37d44a5331c716d6890697e65f8f03ba91 diff --git a/tos/platforms/tmirws/sensors/WindVaneAdcP.nc b/tos/platforms/tmirws/sensors/WindVaneAdcP.nc index a80362ba..b4e92054 100644 --- a/tos/platforms/tmirws/sensors/WindVaneAdcP.nc +++ b/tos/platforms/tmirws/sensors/WindVaneAdcP.nc @@ -28,14 +28,22 @@ */ /** - * 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 */ #include "Msp430Adc12.h" -module BatteryAdcP { +module WindVaneAdcP { provides interface AdcConfigure; } implementation { @@ -43,7 +51,7 @@ 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, */