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 frdm_USB-HID-Mouse-Keyboard_auto by
main.cpp@0:92846b9895f1, 2015-12-31 (annotated)
- Committer:
- GregC
- Date:
- Thu Dec 31 17:24:55 2015 +0000
- Revision:
- 0:92846b9895f1
- Child:
- 1:9203186a82fd
USB HID Mouse/Keyboard Example for Freedom boards
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| GregC | 0:92846b9895f1 | 1 | #include "mbed.h" |
| GregC | 0:92846b9895f1 | 2 | #include "USBMouseKeyboard.h" |
| GregC | 0:92846b9895f1 | 3 | |
| GregC | 0:92846b9895f1 | 4 | DigitalOut led(LED1); |
| GregC | 0:92846b9895f1 | 5 | USBMouseKeyboard key_mouse; |
| GregC | 0:92846b9895f1 | 6 | |
| GregC | 0:92846b9895f1 | 7 | int main(void) { |
| GregC | 0:92846b9895f1 | 8 | while (1) { |
| GregC | 0:92846b9895f1 | 9 | key_mouse.move(60, 0); |
| GregC | 0:92846b9895f1 | 10 | key_mouse.doubleClick(); |
| GregC | 0:92846b9895f1 | 11 | key_mouse.keyCode(KEY_CAPS_LOCK); |
| GregC | 0:92846b9895f1 | 12 | key_mouse.printf("hello world from frdm-k64f. \n"); |
| GregC | 0:92846b9895f1 | 13 | wait(2); |
| GregC | 0:92846b9895f1 | 14 | key_mouse.move(-60, 0); |
| GregC | 0:92846b9895f1 | 15 | key_mouse.doubleClick(); |
| GregC | 0:92846b9895f1 | 16 | key_mouse.keyCode(KEY_CAPS_LOCK); |
| GregC | 0:92846b9895f1 | 17 | key_mouse.printf("hello world from frdm-k64f. \n"); |
| GregC | 0:92846b9895f1 | 18 | led = ((key_mouse.lockStatus() & 0x2) >> 1); /* second bit is caps lock */ |
| GregC | 0:92846b9895f1 | 19 | wait(2); |
| GregC | 0:92846b9895f1 | 20 | } |
| GregC | 0:92846b9895f1 | 21 | } |
