Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
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,170

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

118 projects • 40 followers

Comments