Skip to content
Snippets Groups Projects
Select Git revision
  • f94cc8e75019c494ab5b6abbbac8a4a6200b54fe
  • main default protected
  • latest
3 results

write.bash

Blame
  • led.c 354 B
    #include <avr/io.h>
    #include <util/delay.h>
     
    #define BLINK_DELAY_MS 1000
     
    int main (void)
    {
     /* set pin 5 of PORTB for output*/
     DDRB |= _BV(DDB5);
     
     while(1) {
      /* set pin 5 high to turn led on */
      PORTB |= _BV(PORTB5);
      _delay_ms(BLINK_DELAY_MS);
     
      /* set pin 5 low to turn led off */
      PORTB &= ~_BV(PORTB5);
      _delay_ms(BLINK_DELAY_MS);
     }
    }