Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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 |
--- 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