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:
2:e09ad9c1f751
Parent:
1:2507a3379f17
Child:
3:3e9586433ce5
--- a/CMPS03.h	Mon May 21 16:13:10 2018 +0000
+++ b/CMPS03.h	Tue May 22 17:15:22 2018 +0000
@@ -36,7 +36,7 @@
 #define CMPS03_H
 
 /**
- * Includes
+ * Includes : Mbed Library
  */
 #include "mbed.h"
 
@@ -53,6 +53,7 @@
 
 /**
  * CMPS03 digital compass module.
+ * more information : http://www.robot-electronics.co.uk/htm/cmps3tech.htm
  */
 class CMPS03 {
 
@@ -71,36 +72,34 @@
 public :
 
     /**
-     * Constructor.
-     * If not used, the two I2C pins should be pulled up.
+     * Constructor of a CMPS03 Compass object.
+     * @note 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
-     * @param scl mbed pin to use as the I2C serial clock
-     * @param address is the I2C adress of the compass
+     * @param pwm : mbed pin to use to get the bearing Pulse
+     * @param sda : mbed pin to use as the I2C serial data
+     * @param scl : mbed pin to use as the I2C serial clock
+     * @param address : I2C adress of the compass
      */
     CMPS03(PinName pwm, PinName sda, PinName scl, int address = 0xC0);
 
     /**
-     * Reads the software revision register [register 0] on the device.
+     * Reads the software revision register of the compass (I2C register 0).
      *
-     * @return The contents of the software revision register as a byte.
+     * @return Software revision register (as a byte).
      */
     char readSoftwareRevision(void);
 
     /**
-     * Reads the current bearing of the compass.
+     * Reads the current bearing of the compass (I2C registers 2 and 3).
      *
-     * @return The current bearing of the compass as a value between 0.0 and 359.9,
-     *         representing 0 - 359.9 degrees.
+     * @return Current bearing of the compass in degree (value between 0.0 and 359.9).
      */
     double readBearing(void);
 
     /**
-     * Reads the last bearing of the compass thru PWM signal (1 bearing each 100ms approx.).
+     * Reads the last bearing of the compass from PWM signal (1 bearing each 100ms approx.).
      *
-     * @return The current bearing of the compass as a value between 0.00 and 359.99,
-     *         representing 0 - 359.99 degrees.
+     * @return Current bearing of the compass in degree (0.00 and 359.99)
      */
     double getBearing(void);