Luke is a pseudonym
/
SDVXcontroller
SDVX controller project
main.cpp@2:19001d314c68, 2018-01-12 (annotated)
- Committer:
- lukeoftheaura
- Date:
- Fri Jan 12 19:19:09 2018 +0000
- Revision:
- 2:19001d314c68
- Parent:
- 1:923d8a726613
- Child:
- 3:b88fff5420e2
meh
Who changed what in which revision?
User | Revision | Line number | New 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 | 0:a698d2e0b81c | 4 | #include "USBHID.h" |
lukeoftheaura | 0:a698d2e0b81c | 5 | |
lukeoftheaura | 0:a698d2e0b81c | 6 | // DigitalIn BT1(PTA2); |
lukeoftheaura | 0:a698d2e0b81c | 7 | Serial PC(USBTX,USBRX); |
lukeoftheaura | 0:a698d2e0b81c | 8 | USBKeyboard key; |
lukeoftheaura | 0:a698d2e0b81c | 9 | DigitalOut LED(LED1); |
lukeoftheaura | 0:a698d2e0b81c | 10 | DigitalIn button1(PTB8); |
lukeoftheaura | 2:19001d314c68 | 11 | bool bt1state = false; |
lukeoftheaura | 0:a698d2e0b81c | 12 | |
lukeoftheaura | 0:a698d2e0b81c | 13 | int main() { |
lukeoftheaura | 0:a698d2e0b81c | 14 | for(;;) { |
lukeoftheaura | 0:a698d2e0b81c | 15 | if(button1 == 0) { |
lukeoftheaura | 0:a698d2e0b81c | 16 | key.keyPress('c'); |
lukeoftheaura | 2:19001d314c68 | 17 | bt1state = true; |
lukeoftheaura | 2:19001d314c68 | 18 | } |
lukeoftheaura | 2:19001d314c68 | 19 | else if(bt1state == true) { |
lukeoftheaura | 2:19001d314c68 | 20 | key.keyRelease(); |
lukeoftheaura | 2:19001d314c68 | 21 | bt1state = false; |
lukeoftheaura | 0:a698d2e0b81c | 22 | } |
lukeoftheaura | 0:a698d2e0b81c | 23 | } |
lukeoftheaura | 0:a698d2e0b81c | 24 | } |