SHARE
TWEET

Untitled

NB52053 Jun 26th, 2019 (edited) 158 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <mega32.h>
  2. #include<delay.h>
  3.  
  4. void main(void)
  5. {
  6.     int i=0;
  7.     char input [5]= {0b00000000,0b00000001,0b00000010,0b00000011,0b00000100};
  8.    
  9. DDRA = 0b11111111;
  10. DDRB = 0b00000000;
  11. while (1)
  12. {
  13.          if (PINB.5 == 0)
  14.         {if(i==5){
  15.                 i=0;
  16.             }
  17.         PORTA = input[i]   ; // pin 3 of Port C voltage is High            
  18.         i=i+1;
  19.         delay_ms(70);  
  20.   }    
  21.  
  22. }
  23.  
  24. }
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
 
Top