tim010 tim010
/
LV8_PAI_GRUPA3_TIM010_ZADATAK2
Nurif, Kenan
Revision 0:4899d3017afd, committed 2014-05-05
- Comitter:
- tim010
- Date:
- Mon May 05 15:55:03 2014 +0000
- Commit message:
- LV8_PAI_GRUPA3_TIM010
Changed in this revision
diff -r 000000000000 -r 4899d3017afd N5110.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/N5110.lib Mon May 05 15:55:03 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/eencae/code/N5110/#adb79338d40f
diff -r 000000000000 -r 4899d3017afd main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon May 05 15:55:03 2014 +0000 @@ -0,0 +1,74 @@ +#include "mbed.h" + +Serial pc(USBTX,USBRX); +DigitalOut red[4] = {dp2, dp1, dp28, dp6}; +DigitalIn kolona[4] = {dp9, dp10, dp11, dp13}; +Ticker ticker; + +Timer db; + +char vratiZnak() +{ + + for(int i = 0; i < 4; i++) + { + red[i] = 0; + } + + char znak = 0; + for(int i = 0; i < 4; i++) + { + red[i] = 1; + for(int j = 0; j < 4; j++) + { + if(kolona[j]==1) + { + + if(db.read_ms() <= 200) break; + + if(i < 3 && j < 3) //znaci broj + return znak = i * 3 + j + 1 + '0'; + else if(j == 3) // znaci slovo + return znak = 'A' + i; + else if(i == 3)//neki znak ili 0 + { + if(j == 1) + return znak = '0'; + if(j == 0) + return znak = '*'; + if(j == 2) + return znak = '#'; + } + db.reset(); + } + } + red[i] = 0; + } +} + +void prikaziZnak() +{ + char c = vratiZnak(); + + if(c != '*') + pc.putc(c); + else if (c == '*') + pc.putc('\n'); +} + + + +int main() +{ + db.start(); + + for(int i = 0; i < 4; i++) + { + red[i] = 0; + } + ticker.attach(&prikaziZnak,0.1); + while(1) + { + + } +} \ No newline at end of file
diff -r 000000000000 -r 4899d3017afd mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon May 05 15:55:03 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/8a40adfe8776 \ No newline at end of file