Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <REGX52.H> //biblioteka do obslugi pinów na plytce
- #define _A 0xC0
- void main(void) {
- while(1) {
- P2 = 0xFE; //
- if(P2 == 0xEE) P1 = 0x8E; // 1 - "F"
- if(P2 == 0xDE) P1 = 0xB0; // 2 - "3"
- if(P2 == 0xBE) P1 = 0xF8; // 3 - "7"
- if(P2 == 0x7E) P1 = 0x83; // 4 - "B"
- else P1 = 0xFF;
- P2 = 0xFD;
- if(P2 == 0xED) P1 = 0xC0; // 5 - "0"
- if(P2 == 0xDD) P1 = 0x99; // 6 - "4"
- if(P2 == 0xBD) P1 = 0x80; // 7 - "8"
- if(P2 == 0x7D) P1 = 0xC6; // 8 - "C"
- else P1 = 0xFF;
- P2 = 0xFB;
- if(P2 == 0xEB) P1 = 0xF9; // 9 - "1"
- if(P2 == 0xDB) P1 = 0x92; // 10 - "5"
- if(P2 == 0xBB) P1 = 0x90; // 11 - "9"
- if(P2 == 0x7B) P1 = 0xA1; // 12 - "D"
- else P1 = 0xFF;
- P2 = 0xF7;
- if(P2 == 0xE7) P1 = 0xA4; // 13 - "2"
- if(P2 == 0xD7) P1 = 0x82; // 14 - "6"
- if(P2 == 0xB7) P1 = 0x88; // 15 - "A"
- if(P2 == 0x77) P1 = 0x86; // 16 - "E"
- else P1 = 0xFF;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement