pawelkl

c---klawiatura-1.5

Apr 7th, 2011
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <REGX52.H>
  2.  
  3. unsigned char key, key1;
  4. unsigned char znak[] = {0xFE,0xFD,0xFB,0xF7};
  5. void analiza (unsigned char x, unsigned char y)
  6.   {
  7.     if(x != y) P2 = x;
  8.   }
  9.  
  10.  
  11. void main(void)
  12.   {
  13.     while(1)
  14.       {
  15.         for(int i=0; i<4; i++)
  16.           {
  17.             P0 = znak[i]; //  1111  1110
  18.             key1 = znak[i];
  19.             key = P0; // odczyt
  20.             analiza(key,key1);
  21.           }
  22.  
  23.       }
  24.   }
Advertisement
Add Comment
Please, Sign In to add comment