df

Dependencies:   mbed

Fork of APP1 by Team APP

Revision:
4:303fb83498fd
Parent:
3:1a9d0f0a50bf
Child:
5:f59b51ac4b40
--- a/Accelerometer.cpp	Sat Jan 14 22:37:34 2017 +0000
+++ b/Accelerometer.cpp	Sat Jan 14 23:32:29 2017 +0000
@@ -22,6 +22,12 @@
     }
 }
 
+bool is_almost_equal(double a, double b, double tolerance)
+{
+    double difference = std::abs(a-b);
+    return (difference <= tolerance);
+}
+
 Accelerometer::Accelerometer(
     PinName sda_pin, 
     PinName scl_pin,