Keyboard section of CO657 class 3

Dependencies:   C12832 USBDevice mbed

Files at this revision

API Documentation at this revision

Comitter:
co657_sjc80
Date:
Thu Nov 19 18:04:21 2015 +0000
Commit message:
Initial commit;

Changed in this revision

C12832.lib Show annotated file Show diff for this revision Revisions of this file
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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 72f574c0ada4 C12832.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832.lib	Thu Nov 19 18:04:21 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/askksa12543/code/C12832/#990d5eec2ef6
diff -r 000000000000 -r 72f574c0ada4 USBDevice.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBDevice.lib	Thu Nov 19 18:04:21 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/USBDevice/#2af474687369
diff -r 000000000000 -r 72f574c0ada4 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 19 18:04:21 2015 +0000
@@ -0,0 +1,43 @@
+/**
+ * (C) Simon Cooksey, 2015
+ * 
+ *  Class 03, Task 1B -- XBee Remote Sender
+ *  MIT
+ */
+ 
+#include "mbed.h"
+
+#include "C12832.h"
+#include "USBKeyboard.h"
+
+Serial xbee(D1, D0);
+USBKeyboard keyboard;
+C12832 lcd(D11, D13, D12, D7, D10);
+
+int main()
+{
+    lcd.locate(0,0);
+    lcd.printf("Keyboard");
+    
+    while(1)
+    {
+        if(xbee.readable())
+        {
+            char command = xbee.getc();
+            switch(command)
+            {
+                case 'u':
+                    keyboard.mediaControl(KEY_VOLUME_UP);
+                    break;
+                case 'd':
+                    keyboard.mediaControl(KEY_VOLUME_DOWN);
+                    break;    
+                case 'p':
+                    keyboard.mediaControl(KEY_PLAY_PAUSE);
+                    break;    
+                default: 
+                    break;
+            }    
+        }    
+    }    
+}
\ No newline at end of file
diff -r 000000000000 -r 72f574c0ada4 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 19 18:04:21 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11
\ No newline at end of file