USB Keyboard and mouse Example. Based on USBMouse

Dependencies:   mbed

main.cpp

Committer:
zackc
Date:
2011-01-18
Revision:
0:86603687efec

File content as of revision 0:86603687efec:

#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("foo");     //sends the word "foo" through the keyboard

        led = !led;     //cycles the LED on/off
        wait(2);        //waits 2 seconds, then repeats
    }
}