![](/media/cache/profiles/2012_sf_avc_095.jpg.50x50_q85.jpg)
Code for autonomous rover for Sparkfun AVC. DataBus won 3rd in 2012 and the same code was used on Troubled Child, a 1986 Jeep Grand Wagoneer to win 1st in 2014.
Dependencies: mbed Watchdog SDFileSystem DigoleSerialDisp
Diff: SimpleFilter/SimpleFilter.cpp
- Revision:
- 0:a6a169de725f
diff -r 000000000000 -r a6a169de725f SimpleFilter/SimpleFilter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimpleFilter/SimpleFilter.cpp Mon May 27 13:26:03 2013 +0000 @@ -0,0 +1,16 @@ +#include "SimpleFilter.h" + +SimpleFilter::SimpleFilter(short shift): _filter_value(0), _shift(shift) { + // nothing to do here, really +} + +short SimpleFilter::filter(short value) { + + _filter_value += (value - (_filter_value >> _shift)); + + return _filter_value >> _shift; +} + +short SimpleFilter::value(void) { + return _filter_value >> _shift; +}