Vjezba 7-7 Dinko Djakovic - modularno programiranje

Dependencies:   mbed

HostIO.cpp

Committer:
djdinko
Date:
2015-05-22
Revision:
0:c771d4ee0a76

File content as of revision 0:c771d4ee0a76:

// HostIO.cpp code for Exercise 7-7
#include "HostIO.h"
#include "SegDisplay.h" // allow access to functions and objects in SegDisplay.cpp
Serial pc(USBTX, USBRX); // communication to host PC
void HostInit(void) {
pc.printf("\n\rType two digit numbers to be displayed on the 7-seg display\n\r");
}
char GetKeyInput(void) {
char c = pc.getc(); // get keyboard data (note numerical ascii range 0x30-0x39) 
pc.printf("%c",c); // print ascii value to host PC terminal
return (c&0x0F); // return value as non-ascii (bitmask c with value 0x0F)
}