// Example from: https://techexplorations.com/blog/arduino/arduino-programming-with-avr-c/
//
// Note: This 100% AVR code.
//       Not a single thing from the Arduino software layer can be used.

#include <avr/io.h>
#include <util/delay.h>

#define LED_PIN PD2
#define LED_DDR DDRD
#define LED_PORT PORTD

int main(void) {
    // Set the LED_PIN as output
    LED_DDR |= (1 << LED_PIN);

    while (1) {
        // Toggle the LED state
        LED_PORT ^= (1 << LED_PIN);

        // Wait for 1 second (1000 milliseconds)
        _delay_ms(1000);
    }

    return 0;
}