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:779121daed68, committed 2016-01-11
- 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
--- /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
--- /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
--- 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(" ");
+
}
}
