Hello everyone,
I'm working on a project to get a little more familiar with PIC's using project euler and a 16x2 lcd screen. while i have taken a class on pic programming and used a freescale uC for my senior project as well as worked with PICs a little at my internship, i was always just editing someone else's code. Now i want to start my own code and use it to keep building up, but i keep getting an error that I'm sure is trivial to some of you but I can't seem to find the cause of it.
here is my code:
I keep getting a syntax error on line 10 of p18f4550.h:
extern volatile near unsigned char SPPDATA;
but I'm sure i didnt change it, so the error must be in my main, which is the only one I wrote any code in. Any help would be appreciated. Thanks in advance
I'm working on a project to get a little more familiar with PIC's using project euler and a 16x2 lcd screen. while i have taken a class on pic programming and used a freescale uC for my senior project as well as worked with PICs a little at my internship, i was always just editing someone else's code. Now i want to start my own code and use it to keep building up, but i keep getting an error that I'm sure is trivial to some of you but I can't seem to find the cause of it.
here is my code:
Rich (BB code):
#include <p18f4550.h>;
#include <xlcd.h>;
#include <stdio.h>;
#include <stdlib.h>;
#include <delays.h>;
void DelayFor18TCY(void)
void DelayPORXLCD(void)
void DelayXLC(void)
#pragma config FOSC = INTOSC_HS;
#pragma config PWRT = OFF;
#pragma config BOR = OFF;
#pragma config WDT = OFF;
#pragma config MCLRE = OFF;
#pragma config PBADEN = OFF;
char Value[10];
unsigned long i;
unsigned long tot5;
unsigned long tot3;
unsigned long mult3;
unsigned long mult5;
unsigned long total1;
unsigned long tot15;
unsigned long mult15;
rom char Answer[] = "ANSWER = "
//project Euler #1 all multiples of 3 & 5 up to 1000 added
main (void)
{
mult3=0;
mult5=0;
tot3=0;
tot5=0;
tot15=0;
mult15=0;
//multiples of 3 loop
for(i=0; tot3<1000; i++)
{
mult3 = mult3+tot3;
tot3 = 3*i;
}
//multiples of 5 loop
for(i=0; tot5<1000; i++)
{
mult5 = mult5+tot5;
tot5 = 5*i;
}
//subtract all multiples of 15 only once
for(i=0; tot15<1000; i++)
{
mult15 = mult15+tot15;
tot15=15*i;
}
//total
total1 = mult5+mult3-mult15;
ltoa(total1,Value);
//LCD output
OpenXLCD(2);
SetDDRamAddr(0xB0);
PutrsXLCD(Answer);
SetDDRamAddr(0xC0);
PutsXLCD(Value);
}
// DelayFor18TCY() provides a 18 Tcy delay
void DelayFor18TCY(void){
for(i=0; i<18; i++){
nop();}
}
// DelayPORXLCD() provides at least 15ms delay
void DelayPORXLCD(void){
Delay1KTCYx(15);
}
// DelayXLCD() provides at least 5ms delay
void DelayXLC(void){
Delay1KTCYx(5);
}
I keep getting a syntax error on line 10 of p18f4550.h:
extern volatile near unsigned char SPPDATA;
but I'm sure i didnt change it, so the error must be in my main, which is the only one I wrote any code in. Any help would be appreciated. Thanks in advance