Advertisement
Guest User

xd

a guest
Mar 18th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.70 KB | None | 0 0
  1. #include <REG51.H>
  2.  
  3. xdata unsigned char PTAC _at_ 0x8000; //odczyt z ADC
  4. xdata unsigned char POT0 _at_ 0x8005; //potencjometr 0
  5. xdata unsigned char WLED _at_ 0x8018;
  6. xdata unsigned char diodyLed _at_ 0x8008;
  7. xdata unsigned char przyciski _at_ 0x8008;
  8. code unsigned char tk7seg[] = {0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71}; //rozpisane od 0-9 i A-F (tj. 10-16)
  9. unsigned char count = 4;
  10. unsigned char stan = 0;
  11. unsigned char buf = 0;
  12.  
  13. unsigned char odczyt = 0;
  14.  
  15. void main (void)
  16. {
  17.     long i;
  18.    
  19.     while (1)
  20.     {
  21.        
  22.        
  23.         buf = 1 << count++;
  24.         if (count == 8)
  25.         {
  26.             count = 4;
  27.         }
  28.         diodyLed = (~stan&15) | buf;
  29.        
  30.         for(i = 0; i < 30000; i++);
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement