Example of moving the mouse in mbed-os
Dependencies: USBDEVICE
Fork of USBKeyboardMouse_with_String_Descriptor by
Diff: main.cpp
- Revision:
- 0:f97b1f255167
- Child:
- 1:d00335a42592
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 08 15:01:33 2011 +0000 @@ -0,0 +1,17 @@ +#include "mbed.h" +#include "USBMouse.h" +#include "USBKeyboard.h" + +DigitalOut led(LED1); +USBMouse mouse; +USBKeyboard keyboard; + +int main() { + while(1) { + mouse.move(18, 10); //moves the mouse down and to the left + keyboard.sendKeys("mbed"); //sends the word "foo" through the keyboard + + led = !led; //cycles the LED on/off + wait(2); //waits 2 seconds, then repeats + } +}