Actions

Talk

Avr2011 Programming The Kit: Difference between revisions

From HacDC Wiki

No edit summary
No edit summary
Line 4: Line 4:


  #include <avr/io.h>
  #include <avr/io.h>
#define F_CPU 8000000UL      
#include <util/delay.h>
  void main(void){
  void main(void){
   DDRB = 0b11111111;
   DDRB = 0b11111111;
   while(1){
   while(1){
     PORTB = 0b11111111;
     PORTB = 0b11111111;
   }   
   }   
  }
  }

Revision as of 23:15, 12 March 2011

I find it helpful to flash the chip with a simple program to turn on all LED's just to ensure all of your LED's work before moving on just in case you put an LED in backwards.

Light Em' Up Program

#include <avr/io.h>		
void main(void){
 DDRB = 0b11111111;
 while(1){
   PORTB = 0b11111111;
 }  
}