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: Hexi_OLED_SSD1351
Diff: accel_mag.h
- Revision:
- 0:a84d2425acba
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/accel_mag.h Fri Jul 26 13:37:55 2019 +0000
@@ -0,0 +1,36 @@
+#ifndef accel_mag_h
+#define accel_mag_h
+#include "mbed.h"
+
+#define FXOS8700_I2C_ADDRESS (0x1E<<1) //SA0pin and SA1pin =0
+
+#define FXOS8700_STATUS 0x00
+#define FXOS8700_MDR_STATUS 0x32
+#define FXOS8700_WHOAMI 0x0D
+#define FXOS8700_CTRL_REG1 0x2A
+#define FXOS8700_M_CTRL_REG1 0x5B
+#define FXOS8700_WHOAMI_VALUE 0xC7
+
+class FXOS8700
+{
+/*Call functions for configuration and data acquisition*/
+ public:
+
+ FXOS8700(PinName sda, PinName scl);
+
+ void configureAccelerometer(void);
+
+ void configureMagnetometer(void);
+
+ void getAccelData(float * da);
+
+ void getMagData(float * dm);
+
+ private:
+ I2C FXOS8700_i2c;
+
+};
+
+#endif
+
+