*/
/**
- * 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>
*/
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;
WindVaneReadP.WPower -> HalWindVaneC.WPower;
WindVaneReadP.WDead -> HalWindVaneC.WDead;
+ components new AverageAngleC(SAMPLES_PER_READ);
+ WindVaneReadP.Average -> AverageAngleC;
+
components new StateC();
WindVaneReadP.State -> StateC;
}