Erick Wan
/
USBKeyboard_HelloWorld
1
Fork of USBKeyboard_HelloWorld by
main.cpp
- Committer:
- wane
- Date:
- 2014-02-28
- Revision:
- 7:7d21d4350d5c
- Parent:
- 5:03a4211d593a
File content as of revision 7:7d21d4350d5c:
#include "mbed.h" #include "USBKeyboard.h" //LED1: NUM_LOCK //LED2: CAPS_LOCK //LED3: SCROLL_LOCK //BusOut leds(LED1, LED2, LED3); DigitalIn fire(p14); //USBKeyboard USBKeyboard keyboard; DigitalOut led(LED1); int main(void) { bool pause = false; while (1) { if (!pause) { //keyboard.mediaControl(KEY_VOLUME_DOWN); keyboard.printf("Hello World from Mbed\r\n"); //keyboard.keyCode('s', KEY_CTRL); //keyboard.keyCode(KEY_CAPS_LOCK); } wait(1); //leds = keyboard.lockStatus(); if (fire) { pause = !pause; led = !led; } } }