CMPS03 Compass library with only PWM support. I2C support will be added shortly, while it will arrive, you may use MBED component library if you wish to use CMPS03 I2C interface

Dependents:   TestBoussole FRC_2018 0hackton_08_06_18 lib_FRC_2019 ... more

Revision:
1:2507a3379f17
Parent:
0:41ff46c0f65a
Child:
2:e09ad9c1f751
--- a/CMPS03.h	Fri May 18 16:36:50 2018 +0000
+++ b/CMPS03.h	Mon May 21 16:13:10 2018 +0000
@@ -72,7 +72,7 @@
 
     /**
      * Constructor.
-     * If not used, the 2 I2C pin should be pulled up.
+     * If not used, the two I2C pins should be pulled up.
      *
      * @param pwm mbed pin to use to get the bearing Pulse
      * @param sda mbed pin to use as the I2C serial data
@@ -94,7 +94,7 @@
      * @return The current bearing of the compass as a value between 0.0 and 359.9,
      *         representing 0 - 359.9 degrees.
      */
-    float readBearing(void);
+    double readBearing(void);
 
     /**
      * Reads the last bearing of the compass thru PWM signal (1 bearing each 100ms approx.).
@@ -102,7 +102,12 @@
      * @return The current bearing of the compass as a value between 0.00 and 359.99,
      *         representing 0 - 359.99 degrees.
      */
-    float getBearing(void);
+    double getBearing(void);
+
+    /** 
+     * A short hand for getBearing
+     */
+    operator double();
     
 };