SHARE
TWEET

Untitled

a guest Dec 5th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int count=0, press=0, step=0;
  2.  
  3. void main()
  4. {
  5.   ANSEL = 0;
  6.   ANSELH = 0;
  7.  
  8.   TRISE=1;
  9.   TRISA=0;
  10.  
  11.   while(1){
  12.     if(PORTE.B0>0){
  13.             PORTA=0b00000010;
  14.             Delay_ms(300);
  15.             step++;
  16.             press=1;
  17.                if (PORTE.B0>0){
  18.                 PORTA=0b00001000;
  19.                 Delay_ms(300);
  20.                 step++;
  21.                   if(PORTE.B0>0){
  22.                    PORTA=0b00100000;
  23.                    Delay_ms(300);
  24.                    step++;
  25.                      if(PORTE.B0>0){
  26.                       PORTA=0b10000000;
  27.                       Delay_ms(300);
  28.                       step++;
  29.                   }
  30.                }
  31.             }
  32.     }
  33.  
  34.     if (press==1){
  35.          EEPROM_Write(0,count++);
  36.          EEPROM_Write(count,step);
  37.          press=0;
  38.          step=0;
  39.     }
  40.  
  41.   PORTA=0;
  42.   }
  43.  
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top