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 hours2,098

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

117 projects • 39 followers

Comments