I'm writing a program for a fancontroller. I'm in a very early stage of the program (only defined some variables, pins and EEPROM memory locations and written a simple get-values-out-of-EEPROM fucntion) but wanted to check for syntax errors. Weirdly, the compiler gave me two errors: "undefined reference to 'setup'" and 'undefined reference to 'loop'". Does anyone know what this means and how I can fix it?
Code=
/*
*Fancontroller
*Author: Simon Beirnaert
*/
//EEPROM memory map
#define FIRSTRUN 512 //Obvious
#define TRESHOLD 0 //Joystick treshold
#define O1STATUS 1 //(1=active)
#define O2STATUS 2 //(1=active)
#define O3STATUS 3 //(1=active)
#define I1STATUS 4 //(0=inactive, 4=active, 1-3=channel assignment)
#define I2STATUS 5 //(0=inactive, 4=active, 1-3=channel assignment)
#define I3STATUS 6 //(0=inactive, 4=active, 1-3=channel assignment)
#define I4STATUS 7 //(0=inactive, 4=active, 1-3=channel assignment)
#define I5STATUS 8 //(0=inactive, 4=active, 1-3=channel assignment)
#define I6STATUS 9 //(0=inactive, 4=active, 1-3=channel assignment)
#define ESSTATUS 10 //Emergency shutdown (1=active)
#define ESTEMP1 11 //Emergency shutdown temp sensor 1 (0=disabled)
#define ESTEMP2 12 //Emergency shutdown temp sensor 2 (0=disabled)
#define ESTEMP3 13 //Emergency shutdown temp sensor 3 (0=disabled)
#define ESTEMP4 14 //Emergency shutdown temp sensor 4 (0=disabled)
#define ESTEMP5 15 //Emergency shutdown temp sensor 5 (0=disabled)
#define ESTEMP6 16 //Emergency shutdown temp sensor 6 (0=disabled)
#define MINRPM1 17 //Minimum RPM channel 1
#define MINRPM2 18 //Minimum RPM channel 2
#define MINRPM3 19 //Minimum RPM channel 3
#define MAXRPM1 20 //Maximum RPM channel 1
#define MAXRPM2 21 //Maximum RPM channel 2
#define MAXRPM3 22 //Maximum RPM channel 3
#define TYPE1 23 //0=fan 1=pump
#define TYPE2 24 //0=fan 1=pump
#define TYPE3 25 //0=fan 1=pump
#define GOAL1 26 //Desired temperature channel 1
#define GOAL2 27 //Desired temperature channel 1
#define GOAL3 28 //Desired temperature channel 1
#define XMIN 29 //X-value on complete left
#define XMAX 30 //x-value on complete right
#define YMIN 31 //Y-value on complete down
#define YMAX 32 //Y-value on complete up
#define MODE 33 /*0=air (no cooperation between channels)
*1=water (channel 2(exhaust fan) and 3(pump) cooperate)
*3=water (user defined pump/fan channels, no cooperation)
*4=user defined code
*/
//Defines
#define OCH 3 //Number of output channels
#define ICH 6 //Number of input channels
//includes
#include <EEPROM.h>
//Pin assignment
//Output channels
const int och[OCH]={9,10,11};
//RPM sensors
const int rpmsens[OCH]={6,7,8};
//LCD pin
const int lcd=2;
//Inputs
const int xaxis=0;
const int yaxis=1;
const int ich[ICH]={2,3,4,5,6,7};
//Global variables
int pwm[OCH]={255,255,255}, //Output channel PWM value
adc[ICH], //Input channel ADC value
temp[ICH], //Input channel temp
ostatus[OCH], //Output channel status
istatus[ICH], //Input channel status
rpm[OCH], //Output channel RPM
esstatus=0, //Emergency shutdown enable
estemp[ICH], //Emergency shutdown temps
minrpm[OCH],
maxrpm[OCH],
type[OCH], //Output channel type
goal[OCH], //Desired temperartures
ymin,ymax,yval,ytresh,ycenter, //Needed values for y-axis
xmin,xmax,xval,xtresh,xcenter, //Needed values for x-axis
mode; //Operating mode
//Functions in order of declaration below loop()
void firstRun(void);
void loadValues(void);
void setup()
{
if(EEPROM.read(FIRSTRUN)) firstRun();
loadValues();
}
void loop()
{
}
void loadValues(void)
{
int i;
for(i=0; i<OCH; i++)
{
ostatus[i]=EEPROM.read(O1STATUS+i);
minrpm[i]=EEPROM.read(MINRPM1+i);
maxrpm[i]=EEPROM.read(MAXRPM1+i);
type[i]=EEPROM.read(TYPE1+i);
goal[i]=EEPROM.read(GOAL1+i);
}
for(i=0; i<ICH; i++)
{
istatus[i]=EEPROM.read(I1STATUS+i);
estemp[i]=EEPROM.read(ESTEMP1+i);
}
esstatus=EEPROM.read(ESSTATUS);
xmin=EEPROM.read(XMIN);
xmax=EEPROM.read(XMAX);
ymin=EEPROM.read(YMIN);
ymax=EEPROM.read(YMAX);
mode=EEPROM.read(MODE);
xcenter=(xmax-xmin)/2;
ycenter=(ymax-ymin)/2;
xtresh=(xmax-xmin)*(5/100);
ytresh=(ymax-ymin)*(5/100);
}
void firstRun(void){}