]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/tmirws/sensors/WindVaneAdcP.nc
Work in process to support Davis instruments aerovane (wind vane).
[tinyos-2.x.git] / tos / platforms / tmirws / sensors / WindVaneAdcP.nc
index a80362bad34021a7db41aea82dacd40b86718b44..b4e920548f8fad9033361f9b099ee767a18b46eb 100644 (file)
  */
  
 /**
- * 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 {
@@ -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, */