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.
Revision 5:c719ca456442, committed 2017-05-26
- Comitter:
- huynh270
- Date:
- Fri May 26 11:23:05 2017 +0000
- Parent:
- 4:48f218aa98a7
- Child:
- 6:b2f9a005340b
- Commit message:
- moved state variables outside of main
Changed in this revision
| mainV6.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/mainV6.cpp Fri May 26 11:18:08 2017 +0000
+++ b/mainV6.cpp Fri May 26 11:23:05 2017 +0000
@@ -187,6 +187,9 @@
pwmR = dutyCycleRight;
}
+enum robot_states {idle=0, search, approach}; //so that we can reference states by name vs number
+int robot_state=idle; // define and start in idle state
+
int main()
{
enableMotorDriver = 0; //safety precaution
@@ -194,9 +197,6 @@
t1.attach( &ledShow, 0.05f ); //ticker
- enum robot_states {idle=0, search, approach}; //so that we can reference states by name vs number
- int robot_state=idle; // define and start in idle state
-
//initialize distance sensors
for( int ii = 0; ii<6; ++ii)
sensors[ii].init(&distance, &bit0, &bit1, &bit2, ii);