Hepta 9axis Sensor(magnetometer)
Dependencies: mbed HeptaBattery
Fork of Lab7-01_template by
Diff: main.cpp
- Revision:
- 15:44477a8ccbbf
- Parent:
- 14:d758d18b2710
- Child:
- 16:2ddb40e12082
--- a/main.cpp Thu Sep 07 13:49:46 2017 +0000 +++ b/main.cpp Sat Aug 17 08:56:29 2019 +0000 @@ -1,12 +1,14 @@ #include "mbed.h" I2C i2c(p28, p27); Serial pc(USBTX, USBRX); +DigitalOut EN(p26); const int addr_accel_gyro = 0xD0; char cmd[2]; const int addr_compus = 0x18; short int mxl,mxh,myl,myh,mzl,mzh,st2; int main() { + EN = 1; // EN pin : high i2c.frequency(100000); cmd[0]=0x6B; cmd[1]=0x00;