![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
USB Keyboard and mouse Example. Based on USBMouse
Fork of USBKeyboardMouse by
Revision 1:9c83250ce43b, committed 2013-05-08
- Comitter:
- Wabouz
- Date:
- Wed May 08 09:33:27 2013 +0000
- Parent:
- 0:86603687efec
- Commit message:
- Un petit programme.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 86603687efec -r 9c83250ce43b main.cpp --- a/main.cpp Tue Jan 18 02:16:00 2011 +0000 +++ b/main.cpp Wed May 08 09:33:27 2013 +0000 @@ -1,17 +1,21 @@ #include "mbed.h" -#include "USBMouse.h" #include "USBKeyboard.h" DigitalOut led(LED1); -USBMouse mouse; +DigitalIn Centre(p14); +DigitalIn Bas(p12); USBKeyboard keyboard; -int main() { +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 + if (Centre) { + keyboard.sendKeys("q"); + wait(0.2); + } + if (Bas) { + keyboard.sendKeys("g"); + wait(0.2); + } } -} +} \ No newline at end of file