by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Diff: main.cpp
- Revision:
- 0:507436d37d5e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 15 21:23:48 2012 +0000 @@ -0,0 +1,21 @@ +/* Program Example 6.5: main.cpp file for modular 7-seg keyboard controller + +This example program includes example code PE6.06, PE6.07, PE6.08, PE6.09 + */ +#include "mbed.h" +#include "HostIO.h" +#include "SegDisplay.h" +char data1, data2; // variable declarations + +int main() { // main program + SegInit(); // call init function + HostInit(); // call init function + while (1) { // infinite loop + data2 = GetKeyInput(); // call to get 1st key press + Seg2 = SegConvert(data2); // call to convert and output + data1 = GetKeyInput(); // call to get 2nd key press + Seg1 = SegConvert(data1); // call to convert and output + pc.printf(" "); // display spaces on host + } +} +