test

Dependencies:   USBDevice mbed

Files at this revision

API Documentation at this revision

Comitter:
USER10
Date:
Thu Nov 16 00:22:02 2017 +0000
Commit message:
HID

Changed in this revision

USBDevice.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 53a565ce0cf6 USBDevice.lib
--- /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
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
diff -r 000000000000 -r 53a565ce0cf6 mbed.bld
--- /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