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 randomSearch by
main.cpp@3:7fe4dd911b58, 2016-02-03 (annotated)
- Committer:
- AndyA
- Date:
- Wed Feb 03 13:01:58 2016 +0000
- Revision:
- 3:7fe4dd911b58
- Parent:
- 2:15eab46e805b
first commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| AndyA | 0:499d030c3e22 | 1 | #include "mbed.h" |
| AndyA | 0:499d030c3e22 | 2 | #include "USBMouseKeyboard.h" |
| AndyA | 0:499d030c3e22 | 3 | |
| AndyA | 1:f2747e954f10 | 4 | USBMouseKeyboard keyboard; |
| AndyA | 3:7fe4dd911b58 | 5 | DigitalIn button(P0_1,PullUp); |
| AndyA | 1:f2747e954f10 | 6 | |
| AndyA | 3:7fe4dd911b58 | 7 | void SetCaps(bool on) |
| AndyA | 3:7fe4dd911b58 | 8 | { |
| AndyA | 3:7fe4dd911b58 | 9 | bool currentlyOn = ((keyboard.lockStatus() & 0x02) == 0x02); |
| AndyA | 3:7fe4dd911b58 | 10 | if (currentlyOn != on) |
| AndyA | 3:7fe4dd911b58 | 11 | keyboard.keyCode(KEY_CAPS_LOCK); |
| AndyA | 3:7fe4dd911b58 | 12 | } |
| AndyA | 1:f2747e954f10 | 13 | |
| AndyA | 1:f2747e954f10 | 14 | main() |
| AndyA | 1:f2747e954f10 | 15 | { |
| AndyA | 3:7fe4dd911b58 | 16 | wait(10); // wait, gives windows a chance to set up the mouse/keyboard drivers. |
| AndyA | 1:f2747e954f10 | 17 | while (true) { |
| AndyA | 3:7fe4dd911b58 | 18 | SetCaps(button == 0); |
| AndyA | 1:f2747e954f10 | 19 | } |
| AndyA | 1:f2747e954f10 | 20 | } |
| AndyA | 1:f2747e954f10 | 21 |
