Example of moving the mouse in mbed-os

Dependencies:   USBDEVICE

Fork of USBKeyboardMouse_with_String_Descriptor by little llumpu

Committer:
llumpu
Date:
Thu Sep 08 15:01:33 2011 +0000
Revision:
0:f97b1f255167
Child:
1:d00335a42592
Added USB String Descriptor

Who changed what in which revision?

UserRevisionLine numberNew contents of line
llumpu 0:f97b1f255167 1 #include "mbed.h"
llumpu 0:f97b1f255167 2 #include "USBMouse.h"
llumpu 0:f97b1f255167 3 #include "USBKeyboard.h"
llumpu 0:f97b1f255167 4
llumpu 0:f97b1f255167 5 DigitalOut led(LED1);
llumpu 0:f97b1f255167 6 USBMouse mouse;
llumpu 0:f97b1f255167 7 USBKeyboard keyboard;
llumpu 0:f97b1f255167 8
llumpu 0:f97b1f255167 9 int main() {
llumpu 0:f97b1f255167 10 while(1) {
llumpu 0:f97b1f255167 11 mouse.move(18, 10); //moves the mouse down and to the left
llumpu 0:f97b1f255167 12 keyboard.sendKeys("mbed"); //sends the word "foo" through the keyboard
llumpu 0:f97b1f255167 13
llumpu 0:f97b1f255167 14 led = !led; //cycles the LED on/off
llumpu 0:f97b1f255167 15 wait(2); //waits 2 seconds, then repeats
llumpu 0:f97b1f255167 16 }
llumpu 0:f97b1f255167 17 }