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 Motordriver
Diff: main.cpp
- Revision:
- 1:bf71a7bd2d3e
- Parent:
- 0:67f5b4041c15
- Child:
- 2:ad080363a22c
--- a/main.cpp Fri Mar 06 17:09:31 2015 +0000 +++ b/main.cpp Fri Mar 06 17:12:47 2015 +0000 @@ -62,6 +62,7 @@ #ifdef DEBUG void callback(); // Interrupt triggered function for serial communication #endif + ////////////////////////////////////////////////////////////////// // Main function int main() @@ -80,6 +81,7 @@ #endif } } + ///////////////////////////////////////////////////////////////// // Control function, implements PID void control() @@ -98,6 +100,7 @@ } else speed=0; // If we've fallen over or are steady on top drive(speed); // Write speed to the motors } + ////////////////////////////////////////////////////////////////// // Drive function void drive(float speed) @@ -159,9 +162,9 @@ #endif } -#ifdef DEBUG ///////////////////////////////////////////////////////////////// // Callback function to change values/gains +#ifdef DEBUG void callback() { char val; // Needed for Serial communication (need to be global?)