State machine
Dependencies: mbed Adafruit_GFX BioroboticsMotorControl MODSERIAL BioroboticsEMGFilter
Diff: main.cpp
- Revision:
- 15:f65b4566193e
- Parent:
- 14:b97e7a41ec23
- Child:
- 16:9c5ef6fe6780
diff -r b97e7a41ec23 -r f65b4566193e main.cpp --- a/main.cpp Wed Oct 31 10:22:07 2018 +0000 +++ b/main.cpp Wed Oct 31 11:05:47 2018 +0000 @@ -147,6 +147,12 @@ // State just changed to this one. screen.clear_display(); screen.display_state_name("Normal operation"); + + control_goes_up = true; + control_goes_right = true; + + screen.display_up_down_arrow(control_goes_up); + screen.display_left_right_arrow(control_goes_right); } double main_target = ((potmeter1.read() * 2) - 1) * PI; @@ -156,9 +162,11 @@ if (ud_button.has_just_been_pressed()) { control_goes_up = !control_goes_up; + screen.display_up_down_arrow(control_goes_up); } if (lr_button.has_just_been_pressed()) { control_goes_right = !control_goes_right; + screen.display_left_right_arrow(control_goes_right); } }