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,671

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

117 projects • 39 followers

Comments