text: /*
   * toggleProject.c
   *
   * Created: 28/10/2020 19:02:51
   * Author : TheGT23
   */ 
  #define LED_GREEN   PB5 // AVR pin where green LED is connected
  #define SHORT_DELAY 250 // Delay in milliseconds
  #ifndef F_CPU           // Preprocessor directive allows for conditional
                          // compilation. The #ifndef means "if not defined".
  #define F_CPU 16000000  // CPU frequency in Hz required for delay
  #endif                  // The #ifndef directive must be closed by #endif
  
  /* Includes ----------------------------------------------------------*/
  /* Include another C language file into the current file at the location
   * of the #include statement prior to compiling the source code.
   */
  #include <util/delay.h> // Functions for busy-wait delay loops
  #include <avr/io.h>     // AVR device-specific IO definitions
  
  /* Function definitions ----------------------------------------------*/
  /**
   * Main function where the program execution begins. Toggle one LED 
   * and use function from the delay library.
   */
  int main(void)
  {
      // Set pin as output in Data Direction Register
      // DDRB = DDRB or 0010 0000
      DDRB = DDRB | (1<<LED_GREEN);
  
      // Set pin LOW in Data Register (LED off)
      // PORTB = PORTB and 1101 1111
      PORTB = PORTB & ~(1<<LED_GREEN);
  
      // Infinite loop
      while (1)
      {
          // Pause several milliseconds
          _delay_ms(SHORT_DELAY);
  
          // Invert LED in Data Register
          // PORTB = PORTB xor 0010 0000
          PORTB = PORTB ^ (1<<LED_GREEN);
      }
  
      // Will never reach this
      return 0;
  }