1

Dependencies:   USBDevice mbed

Fork of USBKeyboard_HelloWorld by Samuel Mokrani

Files at this revision

API Documentation at this revision

Comitter:
wane
Date:
Fri Feb 28 05:14:03 2014 +0000
Parent:
6:17871da2a7e4
Commit message:
1

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 17871da2a7e4 -r 7d21d4350d5c main.cpp
--- a/main.cpp	Fri Mar 01 13:23:58 2013 +0000
+++ b/main.cpp	Fri Feb 28 05:14:03 2014 +0000
@@ -1,21 +1,32 @@
 #include "mbed.h"
 #include "USBKeyboard.h"
- 
+
 //LED1: NUM_LOCK
 //LED2: CAPS_LOCK
 //LED3: SCROLL_LOCK
-BusOut leds(LED1, LED2, LED3);
- 
+//BusOut leds(LED1, LED2, LED3);
+DigitalIn fire(p14);
+
 //USBKeyboard
 USBKeyboard keyboard;
- 
-int main(void) {
+DigitalOut  led(LED1);
+
+int main(void)
+{
+    bool pause = false;
     while (1) {
-        keyboard.mediaControl(KEY_VOLUME_DOWN);
-        keyboard.printf("Hello World from Mbed\r\n");
-        keyboard.keyCode('s', KEY_CTRL);
-        keyboard.keyCode(KEY_CAPS_LOCK);
+        if (!pause) {
+            //keyboard.mediaControl(KEY_VOLUME_DOWN);
+            keyboard.printf("Hello World from Mbed\r\n");
+            //keyboard.keyCode('s', KEY_CTRL);
+            //keyboard.keyCode(KEY_CAPS_LOCK);
+        }
         wait(1);
-        leds = keyboard.lockStatus();
+        //leds = keyboard.lockStatus();
+        if (fire)
+        {
+            pause = !pause;
+            led = !led;
+        }
     }
 }
\ No newline at end of file