Advertisement
NB52053

Untitled

Jun 25th, 2019
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include <mega32.h>
  2. #include <delay.h>
  3. // Declare your global variables here
  4. void main(void)
  5. {
  6. DDRB=0b10101010; // pin 0 of Port B is set as output
  7. PORTB=0b10101010; // pin 0, 1, 2, 3, 4 , 5, 6 , 7 of Port B voltage is Low
  8. DDRC=0b01010101; // pin 0 of Port B is set as output
  9. PORTC=0b01010101; // pin 0, 1, 2, 3, 4 , 5, 6 , 7 of Port B voltage is Low
  10. while (1)
  11. {
  12. PORTB= 0b10101010; // pin 0 of Port B voltage is High
  13. delay_ms(1000);
  14. PORTC=0b01010101; // pin 0 of Port B voltage is Low
  15. delay_ms(1000);
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement