![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
lololololol
Dependencies: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
Diff: main.cpp
- Revision:
- 5:dc3a076bbb10
- Parent:
- 4:4afc587630ea
- Child:
- 6:61618bf71a08
diff -r 4afc587630ea -r dc3a076bbb10 main.cpp --- a/main.cpp Tue Sep 10 18:27:43 2019 +0000 +++ b/main.cpp Thu Sep 12 13:48:12 2019 +0000 @@ -7,7 +7,7 @@ DigitalOut ledb(LED_BLUE); Ticker ReadEnCoder; -char color; +char color='r'; void flicker() { @@ -26,6 +26,26 @@ ledg=1; ledb=!ledb; } + if (color == 'y') { + ledr=!ledr; + ledg=!ledg; + ledb=1; + } + if (color == 'c') { + ledr=1; + ledg=!ledg; + ledb=!ledb; + } + if (color == 'm') { + ledr=!ledr; + ledg=1; + ledb=!ledb; + } + if (color == 'w') { + ledr=!ledr; + ledg=!ledg; + ledb=!ledb; + } } int main() @@ -35,5 +55,25 @@ pc.printf("%c\n\r",color); ReadEnCoder.attach(flicker,0.5); color = pc.getc(); + if (color == 'w') { + ledr=0; + ledg=0; + ledb=0; + } + if (color == 'y') { + ledr=0; + ledg=0; + ledb=1; + } + if (color == 'm') { + ledr=0; + ledg=1; + ledb=0; + } + if (color == 'c') { + ledr=1; + ledg=0; + ledb=0; + } } } \ No newline at end of file