X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=blobdiff_plain;f=tos%2Fplatforms%2Ftmirws%2Fsensors%2FWindVaneAdcC.nc;h=a659995b7672bab3389d16d7a44ed9799084df24;hp=472f9ec7b2e50e519fd752e33a64c44128668b96;hb=108ff439d63ddb1413efe5e9830392bab56e001b;hpb=0363ad37d44a5331c716d6890697e65f8f03ba91 diff --git a/tos/platforms/tmirws/sensors/WindVaneAdcC.nc b/tos/platforms/tmirws/sensors/WindVaneAdcC.nc index 472f9ec7..a659995b 100644 --- a/tos/platforms/tmirws/sensors/WindVaneAdcC.nc +++ b/tos/platforms/tmirws/sensors/WindVaneAdcC.nc @@ -28,14 +28,20 @@ */ /** - * Reads the ADC pin connected to the LiPoly battery. The connection is made - * via a resistor divider where the battery voltage is 3x that read by the ADC. - * Therefore, BattV = ADC / 4096 * 1.5 * 3. + * 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 */ -generic configuration BatteryAdcC() { +generic configuration WindVaneAdcC() { provides interface Read; provides interface ReadStream; @@ -49,13 +55,13 @@ implementation { components new AdcReadStreamClientC(); ReadStream = AdcReadStreamClientC; - components BatteryAdcP; - AdcReadClientC.AdcConfigure -> BatteryAdcP; - AdcReadStreamClientC.AdcConfigure -> BatteryAdcP; + components WindVaneAdcP; + AdcReadClientC.AdcConfigure -> WindVaneAdcP; + AdcReadStreamClientC.AdcConfigure -> WindVaneAdcP; components new AdcReadNowClientC(); Resource = AdcReadNowClientC; ReadNow = AdcReadNowClientC; - AdcReadNowClientC.AdcConfigure -> BatteryAdcP; + AdcReadNowClientC.AdcConfigure -> WindVaneAdcP; }