df

Dependencies:   mbed

Fork of APP1 by Team APP

Revision:
18:a21199781d20
Parent:
15:b38d9d210e32
Child:
21:a111be2582be
--- a/Utility.hpp	Tue Jan 17 06:03:41 2017 +0000
+++ b/Utility.hpp	Tue Jan 17 19:45:02 2017 +0000
@@ -1,9 +1,10 @@
 #ifndef UTILITY_HPP
 #define UTILITY_HPP
+#include <list>
 
 namespace utility
 {
-    const double PI = 3.14159265;
+    const double PI = 3.14159265;    
 
     bool is_almost_equal(double a, double b, double tolerance);
 
@@ -18,6 +19,17 @@
     unsigned int update_bits(const unsigned int previous_4_bytes, const int start_bit, const int stop_bit, const unsigned int reserved_bits_mask, const unsigned int new_bits_value);
     //Hang the program and blink an LED on the mbed
     void blink();
+    
+    class MovingAverageFilter
+    {
+        public:
+            MovingAverageFilter(const int subSize);
+            int calculate(int newValue);
+            
+        private:
+            const int subsetSize;
+            std::list<int> subset;
+    };
 }
 
 #endif
\ No newline at end of file