USER PASS
/
USBHID_Test
test
Diff: main.cpp
- Revision:
- 0:53a565ce0cf6
diff -r 000000000000 -r 53a565ce0cf6 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 16 00:22:02 2017 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "USBKeyboard.h" + +Serial pc2(p13, p14);//tx1, rx1 + +//LED1: NUM_LOCK +//LED2: CAPS_LOCK +//LED3: SCROLL_LOCK +BusOut leds(LED1, LED2, LED3); + +//USBKeyboard +USBKeyboard keyboard; + +int main(void) { + char ch; + while (1) { + if(pc2.readable()) { // 受信確認 + ch = pc2.getc(); // 1文字取り出し + keyboard.printf("%c\r\n", ch); + wait(1); + leds = keyboard.lockStatus(); + } +} +} \ No newline at end of file