Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "reg515.sfr"
- #include "lcd.h"
- int t = 0;
- int limp = 0;
- void main()
- {
- char x;
- int j = 0;
- int wynik=0;
- int k=0;
- int l_j, l_d, l_s;
- CRCH=0xFF;
- CRCL=0x00;
- CCH1=0xFF;
- CCEN=0x08;
- CLK=1;
- P3=0xDF;
- CCL1=50;
- T2CON = 0x11;
- lcd_init();
- while(1)
- {
- x = get_kb();
- wynik = (100 * CCL1)/255;
- l_j = wynik % 10;
- if(wynik != 100)
- l_d = wynik / 10;
- else
- l_d = 0;
- l_s = wynik/ 100;
- out_instr(0x01);
- out_char(l_s+48);
- out_char(l_d+48);
- out_char(l_j+48);
- out_char('%');
- if(x=='g')
- {
- if(CCL1<255)
- CCL1 = CCL1+ 1;
- }
- if(x=='d')
- {
- if(CCL1>0)
- CCL1 = CCL1 - 1;
- }
- for(j=0; j<2000;j++);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement