Project to practice collaboration and header files

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
burritodude
Date:
Mon Jan 11 19:00:56 2016 +0000
Parent:
2:6163059b96e8
Parent:
3:6e8bf95e144d
Commit message:
Branches are merged!

Changed in this revision

diff -r 6163059b96e8 -r 779121daed68 HostIO.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HostIO.cpp	Mon Jan 11 19:00:56 2016 +0000
@@ -0,0 +1,12 @@
+#include "HostIO.h"
+Serial pc(USBTX,USBRX);
+
+void HostInit(void){
+    pc.printf("\n\rType two idgit numbers to be \n\r");
+    }
+    
+    char GetKeyInput(void){
+        char c = pc.getc();
+        pc.printf("%c",c);
+        return(c&0x0F);
+        }
\ No newline at end of file
diff -r 6163059b96e8 -r 779121daed68 HostIO.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HostIO.h	Mon Jan 11 19:00:56 2016 +0000
@@ -0,0 +1,10 @@
+#ifndef HOSTIO_H
+#define HOSTIO_H
+
+#include "mbed.h"
+
+extern Serial pc;
+void HostInit(void);
+char GetKeyInput(void);
+
+#endif
\ No newline at end of file
diff -r 6163059b96e8 -r 779121daed68 main.cpp
--- a/main.cpp	Mon Jan 11 18:54:43 2016 +0000
+++ b/main.cpp	Mon Jan 11 19:00:56 2016 +0000
@@ -1,12 +1,18 @@
 #include "mbed.h"
+#include "Host.IO.h"
+#include "SegDisplay.h"
 
-DigitalOut myled(LED1);
+char data1, data2;
 
 int main() {
+    SegInit();
+    HostInit();
     while(1) {
-        myled = 1;
-        wait(0.2);
-        myled = 0;
-        wait(0.2);
+        data2 = GetKeyInput();
+        Seg2 = SegConvert(data2);
+        data1 = GetKeyInput();
+        Seg1 = SegConvert(data1);
+        pc.printf(" ");
+        
     }
 }