USBMouseKeyboard Hello World

Dependencies:   mbed USBDevice

Committer:
samux
Date:
Fri Mar 01 13:26:37 2013 +0000
Revision:
6:09cebc93f3a7
Parent:
5:656591c7c89f
use latest USBDevice lib (FRDM-KL25Z support)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
samux 0:845782b77b0d 1 #include "mbed.h"
samux 0:845782b77b0d 2 #include "USBMouseKeyboard.h"
samux 5:656591c7c89f 3
samux 3:f34d255ad5e7 4 //LED1: NUM_LOCK
samux 3:f34d255ad5e7 5 //LED2: CAPS_LOCK
samux 3:f34d255ad5e7 6 //LED3: SCROLL_LOCK
samux 1:980859c25e92 7 BusOut leds(LED1, LED2, LED3);
samux 5:656591c7c89f 8
samux 3:f34d255ad5e7 9 //USBMouseKeyboard
samux 3:f34d255ad5e7 10 USBMouseKeyboard key_mouse;
samux 5:656591c7c89f 11
samux 0:845782b77b0d 12 int main(void) {
samux 0:845782b77b0d 13 while (1) {
samux 0:845782b77b0d 14 key_mouse.mediaControl(KEY_VOLUME_DOWN);
samux 0:845782b77b0d 15 key_mouse.printf("Hello World from Mbed\r\n");
samux 0:845782b77b0d 16 key_mouse.keyCode('s', KEY_CTRL);
samux 0:845782b77b0d 17 key_mouse.move(20, 0);
samux 1:980859c25e92 18 key_mouse.keyCode(KEY_SCROLL_LOCK);
samux 4:13ddb5cb421b 19 wait(1);
samux 3:f34d255ad5e7 20 leds = key_mouse.lockStatus();
samux 0:845782b77b0d 21 }
samux 5:656591c7c89f 22 }