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: mbed HeptaBattery
Fork of Lab7-01_template by
Diff: main.cpp
- Revision:
- 15:c9e7bc2c90b9
- Parent:
- 14:1becf2edba9c
- Child:
- 16:52727cc1fb8a
--- a/main.cpp Thu Sep 07 13:31:00 2017 +0000
+++ b/main.cpp Sat Aug 17 08:42:30 2019 +0000
@@ -1,11 +1,13 @@
#include "mbed.h"
I2C i2c(p28, p27);
Serial pc(USBTX, USBRX);
+DigitalOut EN(p26);
const int addr_accel_gyro = 0xD0;
char cmd[2];
short int xl,xh,yl,yh,zl,zh;
int main() {
- i2c.frequency(100000);
+ EN = 1; // EN pin : high
+ i2c.frequency(100000);
cmd[0]=0x6B;
cmd[1]=0x00;
i2c.write(addr_accel_gyro,cmd,2);
