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.
Revision 4:6192f1728e75, committed 2018-01-13
- Comitter:
- lukeoftheaura
- Date:
- Sat Jan 13 20:10:39 2018 +0000
- Parent:
- 3:b88fff5420e2
- Commit message:
- j
Changed in this revision
| USBDevice.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/USBDevice.lib Fri Jan 12 19:28:54 2018 +0000 +++ b/USBDevice.lib Sat Jan 13 20:10:39 2018 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/users/lukeoftheaura/code/usbdevice/#330159d8553d +https://os.mbed.com/users/lukeoftheaura/code/usbdevice/#6fb59df5258d
--- a/main.cpp Fri Jan 12 19:28:54 2018 +0000
+++ b/main.cpp Sat Jan 13 20:10:39 2018 +0000
@@ -1,9 +1,8 @@
#include "mbed.h"
#include "USBKeyboard.h"
#include "USBMouse.h"
-#include "USBHID.h"
+#define ever ;;
-// DigitalIn BT1(PTA2);
Serial PC(USBTX,USBRX);
USBKeyboard key;
DigitalOut LED(LED1);
@@ -11,15 +10,31 @@
bool bt1state = false;
int main() {
- for(;;) {
- LED = button1;
- if(button1 == 0) {
- key.keyPress('c');
+ bool Pressed = false;
+
+ for(ever)
+ {
+ LED = Pressed;
+
+ if (Pressed)
+ {
+ if (button1)
+ {
+ if (key.keyPress(']'))
+ {
+ Pressed = false;
+ }
+ }
}
- wait(0.1);
- key.keyPress('c');
-// else if(button1 == 1) {
-// key.keyPress('c');
-// }
+ else
+ {
+ if (!button1)
+ {
+ if (key.keyPress('d'))
+ {
+ Pressed = true;
+ }
+ }
+ }
}
-}
+}
\ No newline at end of file