NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Error in Code

June 21, 2011
by jkoppp
jkoppp's Avatar

I modified the initialload code so i could use the same make file but every time I try to compile the file I get errors.

Terminal Window

# define F_CPU 14745600

#include <stdio.h>

#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <inttypes.h>

#include "../libnerdkits/delay.h"
#include "../libnerdkits/lcd.h"

// PIN DEFINITIONS:
//
// PC4 -- LED anode
// PC5 -- INPUT Gnd

int main(){

 // LED as output
DDRC |= (1<<PC4);
// Switch as input
 DDRC |= ~(1<<PC3);

  while(1) {
    if(PINC & (1<<PC3) {
    PORTC|=(1<<PC4)
    }
  }
}
June 21, 2011
by Rick_S
Rick_S's Avatar

You missed a semicolon at the end of line 27. That's all I see for now.

Rick

Post a Reply

Please log in to post a reply.

Did you know that you can adjust most wire strippers to make it easier to strip insulation faster? Learn more...