Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.97 KB | None | 0 0
  1. #include <REGX52.H> //biblioteka do obslugi pinów na plytce
  2.  
  3. #define _A 0xC0
  4.  
  5. void main(void) {
  6.     while(1) {
  7.  
  8.         P2 = 0xFE; //
  9.  
  10.         if(P2 == 0xEE) P1 = 0x8E; // 1 - "F"
  11.  
  12.         if(P2 == 0xDE) P1 = 0xB0;   // 2 - "3"
  13.  
  14.         if(P2 == 0xBE) P1 = 0xF8;   // 3 - "7"
  15.  
  16.         if(P2 == 0x7E) P1 = 0x83; // 4 - "B"
  17.  
  18.         else P1 = 0xFF;
  19.  
  20.         P2 = 0xFD;
  21.  
  22.         if(P2 == 0xED) P1 = 0xC0;   // 5 - "0"
  23.  
  24.         if(P2 == 0xDD) P1 = 0x99; // 6 - "4"
  25.  
  26.         if(P2 == 0xBD) P1 = 0x80; // 7 - "8"
  27.  
  28.         if(P2 == 0x7D) P1 = 0xC6; // 8 - "C"
  29.        
  30.         else P1 = 0xFF;                      
  31.  
  32.         P2 = 0xFB;
  33.  
  34.         if(P2 == 0xEB) P1 = 0xF9;   // 9 - "1"
  35.  
  36.         if(P2 == 0xDB) P1 = 0x92;   // 10 - "5"
  37.  
  38.         if(P2 == 0xBB) P1 = 0x90;   // 11 - "9"
  39.  
  40.         if(P2 == 0x7B) P1 = 0xA1; // 12 - "D"
  41.        
  42.         else P1 = 0xFF;                    
  43.  
  44.         P2 = 0xF7;
  45.  
  46.         if(P2 == 0xE7) P1 = 0xA4;   // 13 - "2"
  47.  
  48.         if(P2 == 0xD7) P1 = 0x82;   // 14 - "6"
  49.  
  50.         if(P2 == 0xB7) P1 = 0x88;   // 15 - "A"
  51.  
  52.         if(P2 == 0x77) P1 = 0x86; // 16 - "E"
  53.        
  54.         else P1 = 0xFF;                    
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement