Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <REG51.H>
- xdata unsigned char PTAC _at_ 0x8000; //odczyt z ADC
- xdata unsigned char POT0 _at_ 0x8005; //potencjometr 0
- xdata unsigned char WLED _at_ 0x8018;
- xdata unsigned char diodyLed _at_ 0x8008;
- xdata unsigned char przyciski _at_ 0x8008;
- 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)
- unsigned char count = 4;
- unsigned char stan = 0;
- unsigned char buf = 0;
- unsigned char odczyt = 0;
- void main (void)
- {
- long i;
- while (1)
- {
- buf = 1 << count++;
- if (count == 8)
- {
- count = 4;
- }
- diodyLed = (~stan&15) | buf;
- for(i = 0; i < 30000; i++);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement