robot

Dependencies:   FastPWM3 mbed

Revision:
147:c1b2379b8874
Parent:
146:296bcc30e65d
Child:
150:08c13bfc7417
--- a/Filter/Filter.h	Wed May 03 12:36:51 2017 +0000
+++ b/Filter/Filter.h	Wed May 03 13:27:12 2017 +0000
@@ -3,7 +3,7 @@
 
 class CircularBuffer {
 public:
-    CircularBuffer(int length);
+    CircularBuffer(int length, bool use_median);
     float oldest() {if (oldest_index >= 0) return buf[oldest_index]; return 0.0f;}
     float newest() {if (newest_index >= 0) return buf[newest_index]; return 0.0f;}
     int length() {return _length;}
@@ -17,6 +17,7 @@
     float median();
 private:
     int _length;
+    bool _use_median;
     int oldest_index, newest_index, num;
     float sum;
 private: