Skip to content

Instantly share code, notes, and snippets.

@Aenohe
Last active August 30, 2015 17:29
Show Gist options
  • Select an option

  • Save Aenohe/050f4caeda8ab3d37ee1 to your computer and use it in GitHub Desktop.

Select an option

Save Aenohe/050f4caeda8ab3d37ee1 to your computer and use it in GitHub Desktop.

Revisions

  1. Aenohe revised this gist Aug 30, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion avr-cmu-c-blink-led.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Test AVR Microcontroller with blink-led program written in C
    # blink-led program written in C for AVR Microcontroller

    ```
    #include <avr/io.h>
  2. Aenohe created this gist Aug 30, 2015.
    27 changes: 27 additions & 0 deletions avr-cmu-c-blink-led.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    # Test AVR Microcontroller with blink-led program written in C

    ```
    #include <avr/io.h>
    #define F_CPU 16000000UL
    #include <util/delay.h>
    #define BLINK_DELAY_MS 1000
    void setup() {
    DDRD = 0b00000100;
    PORTD = 0b00000000;
    }
    void loop() {
    PORTD = 0b00000100;
    _delay_ms(BLINK_DELAY_MS);
    PORTD = 0b00000000;
    _delay_ms(BLINK_DELAY_MS);
    }
    int main(void) {
    setup();
    for (;;) {
    loop();
    }
    }
    ```