Luke is a pseudonym
/
SDVXcontroller
SDVX controller project
Diff: main.cpp
- Revision:
- 4:6192f1728e75
- Parent:
- 3:b88fff5420e2
--- a/main.cpp Fri Jan 12 19:28:54 2018 +0000 +++ b/main.cpp Sat Jan 13 20:10:39 2018 +0000 @@ -1,9 +1,8 @@ #include "mbed.h" #include "USBKeyboard.h" #include "USBMouse.h" -#include "USBHID.h" +#define ever ;; -// DigitalIn BT1(PTA2); Serial PC(USBTX,USBRX); USBKeyboard key; DigitalOut LED(LED1); @@ -11,15 +10,31 @@ bool bt1state = false; int main() { - for(;;) { - LED = button1; - if(button1 == 0) { - key.keyPress('c'); + bool Pressed = false; + + for(ever) + { + LED = Pressed; + + if (Pressed) + { + if (button1) + { + if (key.keyPress(']')) + { + Pressed = false; + } + } } - wait(0.1); - key.keyPress('c'); -// else if(button1 == 1) { -// key.keyPress('c'); -// } + else + { + if (!button1) + { + if (key.keyPress('d')) + { + Pressed = true; + } + } + } } -} +} \ No newline at end of file