Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
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 hours5,078

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
124 projects • 45 followers
Contact

Comments

Please log in or sign up to comment.