From: smckown Date: Wed, 4 Nov 2009 03:55:01 +0000 (+0000) Subject: Correct mph calculations in AnemometerP.nc for Davis aerovane. X-Git-Tag: release/2.1.0-2~28 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=5cc70a3e4e0011533504832dc5da948983184e42 Correct mph calculations in AnemometerP.nc for Davis aerovane. --- diff --git a/tos/platforms/tmirws/sensors/AnemometerP.nc b/tos/platforms/tmirws/sensors/AnemometerP.nc index 40f8fc3f..dfb1bae6 100644 --- a/tos/platforms/tmirws/sensors/AnemometerP.nc +++ b/tos/platforms/tmirws/sensors/AnemometerP.nc @@ -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; }