Code to let Gr20's BioRobotics2017 robot come to live.
Dependencies: FastPWM MODSERIAL QEI mbed
Diff: ui.h
- Revision:
- 7:b9a209f889f5
- Parent:
- 5:088917beb5e4
- Child:
- 8:383a0fb48121
--- a/ui.h Mon Nov 13 09:34:39 2017 +0000 +++ b/ui.h Mon Nov 13 10:39:55 2017 +0000 @@ -7,13 +7,11 @@ /** * User interface - * - * Implementation can be found in main.cpp */ namespace ui { // Sample time -const double kSampleTime = 0.5; +static const double kSampleTime = 0.5; // UI states enum State { @@ -23,7 +21,7 @@ }; // UI state description -const char *StateNames[] = { +static const char *StateNames[] = { "Ignore user input", "State switching", "Control robot" @@ -33,11 +31,11 @@ void SwitchState(State new_state); // Current state -State state = IGNORE; +extern State state; // LEDs and Serial -DigitalOut rgb_led[] {LED_RED, LED_GREEN, LED_BLUE}; -MODSERIAL serial(USBTX,USBRX); +extern DigitalOut rgb_led[]; +extern MODSERIAL serial; // Interrupt switches void InterruptSwitch2();