Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <mega32.h>
- #include<delay.h>
- void main(void)
- {
- int i=0;
- char input [5]= {0b00000000,0b00000001,0b00000010,0b00000011,0b00000100};
- DDRA = 0b11111111;
- DDRB = 0b00000000;
- while (1)
- {
- if (PINB.5 == 0)
- {if(i==5){
- i=0;
- }
- PORTA = input[i] ; // pin 3 of Port C voltage is High
- i=i+1;
- delay_ms(70);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement