Patrick Fitzgerald
Published

AVR-GCC program Atmega328p

AVR-GCC is a suite of programming tools for the Atmel and MicroChip MCUs. Let's program a light to blink.

IntermediateProtip3 hours1,522

Things used in this project

Software apps and online services

SimulIDE
winavr

Story

Read more

Code

math.c

C/C++
C language program for Arduino Uno
counts on PORTB
// PORTB is an 8bit number at address 0x25
#define F_CPU 16000000
#include <avr/io.h>
#include <util/delay.h>
int main(void){      DDRB = 0xFF; 	// turn PORTB on
        while(1)    {PORTB++;  	    // increment PORTB
                    _delay_ms(100);	}}

Credits

Patrick Fitzgerald

Patrick Fitzgerald

100 projects • 28 followers

Comments