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
- Committer:
- AndyA
- Date:
- 2016-02-03
- Revision:
- 3:7fe4dd911b58
- Parent:
- 2:15eab46e805b
File content as of revision 3:7fe4dd911b58:
#include "mbed.h"
#include "USBMouseKeyboard.h"
USBMouseKeyboard keyboard;
DigitalIn button(P0_1,PullUp);
void SetCaps(bool on)
{
bool currentlyOn = ((keyboard.lockStatus() & 0x02) == 0x02);
if (currentlyOn != on)
keyboard.keyCode(KEY_CAPS_LOCK);
}
main()
{
wait(10); // wait, gives windows a chance to set up the mouse/keyboard drivers.
while (true) {
SetCaps(button == 0);
}
}
