Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int count=0, press=0, step=0;
- void main()
- {
- ANSEL = 0;
- ANSELH = 0;
- TRISE=1;
- TRISA=0;
- while(1){
- if(PORTE.B0>0){
- PORTA=0b00000010;
- Delay_ms(300);
- step++;
- press=1;
- if (PORTE.B0>0){
- PORTA=0b00001000;
- Delay_ms(300);
- step++;
- if(PORTE.B0>0){
- PORTA=0b00100000;
- Delay_ms(300);
- step++;
- if(PORTE.B0>0){
- PORTA=0b10000000;
- Delay_ms(300);
- step++;
- }
- }
- }
- }
- if (press==1){
- EEPROM_Write(0,count++);
- EEPROM_Write(count,step);
- press=0;
- step=0;
- }
- PORTA=0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement