Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <mega32.h>
- #include <delay.h>
- // Declare your global variables here
- void main(void)
- {
- DDRB=0b10101010; // pin 0 of Port B is set as output
- PORTB=0b10101010; // pin 0, 1, 2, 3, 4 , 5, 6 , 7 of Port B voltage is Low
- DDRC=0b01010101; // pin 0 of Port B is set as output
- PORTC=0b01010101; // pin 0, 1, 2, 3, 4 , 5, 6 , 7 of Port B voltage is Low
- while (1)
- {
- PORTB= 0b10101010; // pin 0 of Port B voltage is High
- delay_ms(1000);
- PORTC=0b01010101; // pin 0 of Port B voltage is Low
- delay_ms(1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement