2018 revision to classic DataBus AVC code.
Dependencies: LSM303DLM Servo SerialGraphicLCD L3G4200D IncrementalEncoder SimpleShell
Diff: main.cpp
- Revision:
- 12:3cd91e150d9c
- Parent:
- 11:8ec858b7c6d1
- Child:
- 13:5566df1250f1
diff -r 8ec858b7c6d1 -r 3cd91e150d9c main.cpp --- a/main.cpp Wed Dec 12 17:20:16 2018 +0000 +++ b/main.cpp Wed Dec 12 17:32:24 2018 +0000 @@ -31,11 +31,18 @@ void read_gyro() { + int g[3]; + Updater *u = Updater::instance(); - printf("Gyro: %d\n", u->get_gyro()); + u->gyro(g); - //printf("Gyro: %d, %d, %d\n", g[0], g[1], g[2]); + printf("Gyro: %d, %d, %d\n", g[0], g[1], g[2]); +} + +void reset() +{ + NVIC_SystemReset(); } /******** MAIN ********/ @@ -76,6 +83,7 @@ // Startup shell sh.attach(test, "test"); sh.attach(read_gyro, "gyro"); + sh.attach(reset, "reset"); thread.start(callback(&sh, &SimpleShell::run)); // Startup updater