test

Dependencies:   USBDevice mbed

main.cpp

Committer:
USER10
Date:
2017-11-16
Revision:
0:53a565ce0cf6

File content as of revision 0:53a565ce0cf6:

#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();
            }
}
}