by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
HostIO.cpp
- Committer:
- robt
- Date:
- 2012-10-15
- Revision:
- 0:507436d37d5e
File content as of revision 0:507436d37d5e:
/* Program Example 6.8: HostIO.cpp code for modular 7-seg keyboard controller */ #include "HostIO.h" Serial pc(USBTX, USBRX); // communication to host PC void HostInit(void) { pc.printf("\n\rType two digit numbers to be \n\r"); } char GetKeyInput(void) { char c = pc.getc(); // get keyboard ascii data pc.printf("%c",c); // print ascii value to host PC terminal return (c&0x0F); // return value as non-ascii }