Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of priustroller by
Diff: currentsensors.cpp
- Revision:
- 7:76d6ceb23e0d
- Parent:
- 6:99ee0ce47fb2
diff -r 99ee0ce47fb2 -r 76d6ceb23e0d currentsensors.cpp --- a/currentsensors.cpp Wed Mar 04 15:33:32 2015 +0000 +++ b/currentsensors.cpp Thu Mar 05 11:02:54 2015 +0000 @@ -8,11 +8,7 @@ } void AnalogCurrentSensor::Zero() { - float mean = 0; - for(int i = 1; i<=1000; i++){ - mean = 0.1f*((float) *_in) + 0.9f*mean; - } - _zero_level = mean; + _zero_level = (float) *_in; } float AnalogCurrentSensor::GetCurrent() {