START A PROJECT WITH ATmega328p

Blinking an External LED with ATmega328

🧰 Requirements • ATmega328P microcontroller • External LED • A resistor • Breadboard and USB Cable • AVR toolchain (e.g., Atmel Studio, avr-gcc, or Arduino IDE)

#CODE


void setup() {
  DDRD = 4;
  DDRB = 32;
  while(true){
    PORTD = 4;
    delay(500);
    PORTD = 0;
    PORTB = 32;
    delay(500);
    PORTB = 0;
    
    
  }
}





void loop() {
}