]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/tmirws/sensors/WindVaneReadC.nc
Updates to WindVaneReadC
[tinyos-2.x.git] / tos / platforms / tmirws / sensors / WindVaneReadC.nc
index 3b467349d722b85afad20ea5b8d3091e76b98bc0..732db2640d909bfe931c1d43de9971ff93c7f77f 100644 (file)
@@ -28,7 +28,8 @@
  */
  
 /**
- * Take an instantaneous reading of the wind vane position, in degrees.
+ * Take an instantaneous reading of the wind vane position as a 10 bit unsigned
+ * value.
  * 
  * @author R. Steve McKown <smckown@gmail.com>
  */
@@ -37,12 +38,13 @@ configuration WindVaneReadC {
   provides interface Read<uint16_t>;
 }
 implementation {
-  components WindVaneReadP;
+  enum { SAMPLES_PER_READ = 4, };
+
+  components new WindVaneReadP(SAMPLES_PER_READ);
   Read = WindVaneReadP;
 
-  components new MultiSampleC(uint16_t, 4);
-  WindVaneReadP.Count -> MultiSampleC;
-  WindVaneReadP.SubRead -> MultiSampleC;
+  components new MultiSampleC(SAMPLES_PER_READ);
+  WindVaneReadP.ReadRef -> MultiSampleC;
 
   components WindVaneAdcP;
   MultiSampleC.AdcConfigure -> WindVaneAdcP;
@@ -51,6 +53,9 @@ implementation {
   WindVaneReadP.WPower -> HalWindVaneC.WPower;
   WindVaneReadP.WDead -> HalWindVaneC.WDead;
 
+  components new AverageAngleC(SAMPLES_PER_READ);
+  WindVaneReadP.Average -> AverageAngleC;
+
   components new StateC();
   WindVaneReadP.State -> StateC;
 }