Vjezba 7-7 Dinko Djakovic - modularno programiranje
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:c771d4ee0a76
diff -r 000000000000 -r c771d4ee0a76 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri May 22 15:57:04 2015 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" +#include "HostIO.h" +#include "SegDisplay.h" +char data1, data2; // variable declarations +int main() { // main program +SegInit(); // call function to initialise the 7-seg displays +HostInit(); // call function to initialise the host terminal +while (1) { // infinite loop +data2 = GetKeyInput(); // call function to get 1st key press +Seg2 = SegConvert(data2); // call function to convert and output +data1 = GetKeyInput(); // call function to get 2nd key press +Seg1 = SegConvert(data1); // call function to convert and output +pc.printf(" "); // display spaces between 2 digit numbers +} +} \ No newline at end of file