Skip to content

Instantly share code, notes, and snippets.

@rafalw
Created November 30, 2012 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafalw/4176869 to your computer and use it in GitHub Desktop.
Save rafalw/4176869 to your computer and use it in GitHub Desktop.
Test ATmega48 - avr-gcc (+Eclipse)
/*
* main.c
*
* Created on: 2012-11-29
* Author: Rafał Wileczek
*/
#include <avr/io.h>
#include <util/delay.h>
/*
* Zapalanie trzech diod LED na przemian
* - test avr-gcc i dodatku do Eclipse.
*/
int main(void)
{
DDRC = 0x3F;
while(1)
{
PORTC = 1;
_delay_ms(1000);
PORTC = 2;
_delay_ms(1000);
PORTC = 4;
_delay_ms(1000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment