Practical Robotics Modular Robot Library
Diff: led.cpp
- Revision:
- 3:8762f6b2ea8d
- Parent:
- 1:a6728adaf7e7
- Child:
- 4:c2e933d53bea
diff -r bf34b86aa0f3 -r 8762f6b2ea8d led.cpp --- a/led.cpp Sat Nov 26 21:50:10 2016 +0000 +++ b/led.cpp Mon Nov 28 22:41:14 2016 +0000 @@ -9,6 +9,14 @@ char red_led_states [8]; char green_led_states [8]; +void Led::all_off() +{ + for(int i=0;i<8;i++){ + set_green_led(i,0); + set_red_led(i,0); + } +} + void Led::set_green_led (char led, char brightness) { if(led < 8) { @@ -85,6 +93,11 @@ led_ticker.attach(this,&Led::test_ticker_routine,0.02); } +void Led::stop_test() +{ + led_ticker.detach(); +} + void Led::test_ticker_routine() { led_ticker_sub_state += increment;