tim007 tim007
/
Lab2_Grupa6_Tim007_Zadatak3
Džafić Faris Hasković Nedžad
Diff: main.cpp
- Revision:
- 0:76744b0a1fd1
diff -r 000000000000 -r 76744b0a1fd1 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Mar 13 17:04:51 2014 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" + +BusOut ledice(dp23, dp24, dp25, dp26, dp27, dp5, dp6, dp28); +DigitalOut myled(LED1); +DigitalOut enable(dp14); +DigitalOut red[4] = {dp16, dp15, dp17, dp18}; +DigitalIn kolona[4] = {dp9, dp10, dp11, dp13}; + +char matrica[4][4] = {{'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'}}; + +char dajOznaku(int red) { + for(int i=0; i<4; i++) if(kolona[i] == 1) return matrica[i][znak-1]; + return 'x'; +} + +int main() { + enable = 0; + while(1) { + char k('x'); + for(int i(0); i<4; i++) + if(k>='0' && k<='9') ledice = k-'0'; + } +}