USER PASS
/
USBHID_Test
test
Revision 0:53a565ce0cf6, committed 2017-11-16
- Comitter:
- USER10
- Date:
- Thu Nov 16 00:22:02 2017 +0000
- Commit message:
- HID
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBDevice.lib Thu Nov 16 00:22:02 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/USBDevice/#335f2506f422
--- /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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 16 00:22:02 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/5e5da4a5990b \ No newline at end of file