*/
/**
- * 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 <rsmckown@gmail.com>
*/
-generic configuration BatteryAdcC() {
+generic configuration WindVaneAdcC() {
provides interface Read<uint16_t>;
provides interface ReadStream<uint16_t>;
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;
}