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.
Dependencies: mbed ros_lib_kinetic
Diff: utilities.h
- Revision:
- 0:dd126a1080d3
- Child:
- 1:40bdbe1a93b7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/utilities.h Tue Feb 14 05:12:54 2017 +0000
@@ -0,0 +1,23 @@
+
+#ifndef UTILITIES_H_INCLUDED
+#define UTILITIES_H_INCLUDED
+
+#include "mbed.h"
+
+namespace utils {
+ // From http://playground.arduino.cc/Main/Smooth
+ /*Details: Smooth takes three parameters, the value to smoothed, the filter value (filterVal), and smoothedVal.
+
+ float sensVal - the sensor variable - raw material to be smoothed
+
+ float filterVal - The filter value is a float and must be between 0 and .9999 say. 0 is off (no smoothing) and .9999 is maximum smoothing.
+ The actual performance of the filter is going to be dependent on fast you are sampling your sensor (the total loop time), so
+ some trial and error will probably be necessary to get the desired response.
+
+ smoothedVal - Use this for the output of the sensor and also feed it back into the loop. Each sensor needs its own value.
+ Don't use this variable for any other purpose.*/
+ float smooth(float data, float filterVal, float smoothedVal);
+} // end utils namespace
+
+
+#endif // End include guard
\ No newline at end of file