fbpx

Interface Led With AVR

Description

Led have two pins, Anode(+) and Cathode(-), Anode connected with AVR P1.0 pin and Cathode is connected with 5v in Series with 220 ohms resistor.

Hardware Required

  • Led.
  • Atmega16 MicroController.

Circuit

Virtual Circuit

Code

 #include <avr/io.h>
 #include <util/delay.h>
 int main(void)
 {
 DDRA=0xff;
 while(1)
 {
 PORTA=1;
 _delay_ms(1000);
 PORTA=0;
 _delay_ms(1000);
 }
 } 

Leave a Reply

Your email address will not be published. Required fields are marked *