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

MPLabX C language program for Arduino Uno

Program an Arduino Uno in the C language using the MPLabX IDE. Upload with Avrdude.

BeginnerProtip2 hours4,763

Things used in this project

Story

Read more

Code

newmain.c

C/C++
C code that enables all output pins on PORTB of the Atmega chip. A binary count will turn on and off the 5th pin of PORTB where the Uno board has a built-in LED. The LED will blink about once per second.
#include <avr/io.h>
int main(void){   DDRB = 0xFF;
    while(1){PORTB++;
    int i; for (i=0; i < 0x7FFF; i++){;}}}

Credits

Patrick Fitzgerald

Patrick Fitzgerald

118 projects • 40 followers

Comments