]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/tmirws/sensors/AnemometerP.nc
Correct mph calculations in AnemometerP.nc for Davis aerovane.
[tinyos-2.x.git] / tos / platforms / tmirws / sensors / AnemometerP.nc
index 40f8fc3f8bf0de2a07c6942a6d74f142363ccfcb..dfb1bae697b58fbb5b2ae09620f80b6ee6a0a15b 100644 (file)
@@ -55,7 +55,7 @@ implementation {
   /* Convert counts per second to mph */
   uint8_t toMph(uint8_t cps)
   {
-    return (uint8_t)(2.453 * (cps >> 1) + 0.5);
+    return 2.25 * cps + 0.5;
   }