Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <REGX51.H>
- void main(void)
- {
- unsigned char wiersze[4] = {0xF7,0xEF,0xDF,0xBF};
- unsigned char wartosci[12] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0B,0x00,0x0A};
- unsigned char wyjscie1=0;
- unsigned char wyjscie2=0;
- char i = 0;
- P3=0x00;
- while(1)
- {
- P1 = wiersze[i];
- if(P1 == wiersze[i]) {;}
- else
- {
- if(P1_0==0)
- {
- if(i==3)
- {
- wyjscie1 = 0;
- wyjscie2 = 0;
- P3=0x00;
- }
- else
- {
- wyjscie2 = wyjscie1;
- wyjscie1 = wartosci[i*3];
- for(;;)
- {
- if(P1_0 == 0)
- {;}
- else
- break;
- }
- }
- }
- else if(P1_1 == 0)
- {
- wyjscie2 = wyjscie1;
- wyjscie1 = wartosci[i*3 + 1];
- for(;;)
- {
- if(P1_1 == 0)
- {;}
- else
- break;
- }
- }
- else if(P1_2 == 0)
- {
- if(i == 3)
- {
- P3 = wyjscie1|(wyjscie2 <<4);
- }
- else
- {
- wyjscie2 = wyjscie1;
- wyjscie1 = wartosci[i*3+2];
- }
- for(;;)
- {
- if(P1_2 == 0)
- {;}
- else
- break;
- }
- }
- }
- if(i == 3)
- i = 0;
- else
- i++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement