SDVX controller project

Dependencies:   USBDevice mbed

Committer:
lukeoftheaura
Date:
Sat Jan 13 20:10:39 2018 +0000
Revision:
4:6192f1728e75
Parent:
3:b88fff5420e2
j

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lukeoftheaura 0:a698d2e0b81c 1 #include "mbed.h"
lukeoftheaura 0:a698d2e0b81c 2 #include "USBKeyboard.h"
lukeoftheaura 0:a698d2e0b81c 3 #include "USBMouse.h"
lukeoftheaura 4:6192f1728e75 4 #define ever ;;
lukeoftheaura 0:a698d2e0b81c 5
lukeoftheaura 0:a698d2e0b81c 6 Serial PC(USBTX,USBRX);
lukeoftheaura 0:a698d2e0b81c 7 USBKeyboard key;
lukeoftheaura 0:a698d2e0b81c 8 DigitalOut LED(LED1);
lukeoftheaura 0:a698d2e0b81c 9 DigitalIn button1(PTB8);
lukeoftheaura 2:19001d314c68 10 bool bt1state = false;
lukeoftheaura 0:a698d2e0b81c 11
lukeoftheaura 0:a698d2e0b81c 12 int main() {
lukeoftheaura 4:6192f1728e75 13 bool Pressed = false;
lukeoftheaura 4:6192f1728e75 14
lukeoftheaura 4:6192f1728e75 15 for(ever)
lukeoftheaura 4:6192f1728e75 16 {
lukeoftheaura 4:6192f1728e75 17 LED = Pressed;
lukeoftheaura 4:6192f1728e75 18
lukeoftheaura 4:6192f1728e75 19 if (Pressed)
lukeoftheaura 4:6192f1728e75 20 {
lukeoftheaura 4:6192f1728e75 21 if (button1)
lukeoftheaura 4:6192f1728e75 22 {
lukeoftheaura 4:6192f1728e75 23 if (key.keyPress(']'))
lukeoftheaura 4:6192f1728e75 24 {
lukeoftheaura 4:6192f1728e75 25 Pressed = false;
lukeoftheaura 4:6192f1728e75 26 }
lukeoftheaura 4:6192f1728e75 27 }
lukeoftheaura 2:19001d314c68 28 }
lukeoftheaura 4:6192f1728e75 29 else
lukeoftheaura 4:6192f1728e75 30 {
lukeoftheaura 4:6192f1728e75 31 if (!button1)
lukeoftheaura 4:6192f1728e75 32 {
lukeoftheaura 4:6192f1728e75 33 if (key.keyPress('d'))
lukeoftheaura 4:6192f1728e75 34 {
lukeoftheaura 4:6192f1728e75 35 Pressed = true;
lukeoftheaura 4:6192f1728e75 36 }
lukeoftheaura 4:6192f1728e75 37 }
lukeoftheaura 4:6192f1728e75 38 }
lukeoftheaura 0:a698d2e0b81c 39 }
lukeoftheaura 4:6192f1728e75 40 }