This is the one where I went back and un-did the cube.cpp file
Dependencies: BNO055_fusion_tom FastPWM mbed
Fork of NucleoCube1 by
Diff: main.cpp
- Revision:
- 5:9247f07a954a
- Parent:
- 4:ae9e664301dd
- Child:
- 6:f2c930a90873
diff -r ae9e664301dd -r 9247f07a954a main.cpp --- a/main.cpp Wed Apr 05 19:40:14 2017 +0000 +++ b/main.cpp Sun Apr 09 00:47:55 2017 +0000 @@ -9,11 +9,16 @@ Serial pc(SERIAL_TX, SERIAL_RX); +Ticker pwmint; DigitalOut myled(LED1); PwmOut P1(PE_9); PwmOut P2(PE_11); PwmOut P3(PE_13); +void pwmupdate() { + myled = !myled; + } + int main() { //int i = 1; @@ -32,6 +37,7 @@ pc.printf("CHIP:0x%02x, ACC:0x%02x, MAG:0x%02x, GYR:0x%02x, , SW:0x%04x, , BL:0x%02x\r\n", bno055_id_inf.chip_id, bno055_id_inf.acc_id, bno055_id_inf.mag_id, bno055_id_inf.gyr_id, bno055_id_inf.sw_rev_id, bno055_id_inf.bootldr_rev_id); + pwmint.attach(&pwmupdate,.03); while(1) { // acc.getAccAllAxis(data); @@ -41,10 +47,7 @@ euler_angles.h, euler_angles.r, euler_angles.p); wait(0.2); - //pc.printf("This program runs since %d seconds.\n", i++); - //pc.putc(pc.getc()); - - myled = !myled; + P1 = (euler_angles.h/360.0); P2 = (euler_angles.r/360.0); P3 = (euler_angles.p/360.0);