need help with coding for the interactive table designed by grahmaustin

i just cant get it to compile here is the code


/***                  
PIN ASSIGNMENTS ON ATMEGA48

PC6 (PCINT14/RESET)           
PC5 (ADC5/SCL/PCINT13)            // I2C Clock input
PC4 (ADC4/SDA/PCINT12)            // I2C Data input
PC3 (ADC3/PCINT11)                    //Sensor 4 IR Receiver
PC2 (ADC2/PCINT10)                    //Sensor 3 IR Receiver
PC1 (ADC1/PCINT9)                      //Sensor 2 IR Receiver
PC0 (ADC0/PCINT8)                      //Sensor 1 IR Receiver

PB7 (PCINT7/XTAL2/TOSC2)         //IR 4 Trigger
PB6 (PCINT6/XTAL1/TOSC1)         //IR 3 Trigger
PB5 (SCK/PCINT5)                           //IR 2 Trigger
PB4 (MISO/PCINT4)                        //IR 1 Trigger
PB3 (MOSI/OC2A/PCINT3)            //PWM 3
PB2 (SS/OC1B/PCINT2)          
PB1 (OC1A/PCINT1)              
PB0 (PCINT0/CLKO/ICP1)          

PD0 (PCINT16/RXD)               
PD1 (PCINT17/TXD)               
PD2 (PCINT18/INT0)               
PD3 (PCINT19/OC2B/INT1)         //PWM 4
PD4 (PCINT20/XCK/T0)           
PD5 (PCINT21/OC0B/T1)             //PWM 2
PD6 (PCINT22/OC0A/AIN0)         //PWM 1
PD7 (PCINT23/AIN1)            
***/

#define IR_1_ON PORTB |= (1<<4)
#define IR_2_ON PORTB |= (1<<5)
#define IR_3_ON PORTB |= (1<<6)
#define IR_4_ON PORTB |= (1<<7)
#define IR_1_OFF PORTB &= ~(1<<4)
#define IR_2_OFF PORTB &= ~(1<<5)
#define IR_3_OFF PORTB &= ~(1<<6)
#define IR_4_OFF PORTB &= ~(1<<7)

#define PWM1 6                    //PORTD        PWM pin assignments
#define PWM2 5                    //PORTD
#define PWM3 3                    //PORTB
#define PWM4 3                    //PORTD

#define F_CPU 8000000UL

#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
//#include

/****Function Declarations****/
int ADC_read(void);
void A2D_Channel_Select(unsigned char channel);
void Init_ADC(void);
void Init_Timer0(void);
void Init_Timer1(void);
void Init_Timer2(void);
void Delay(void);
void Calibrate_Sensors(void);
//void Init_I2C_Slave_Rx(void);

/****Global Variable Declarations****/
volatile char Sensor_Values_Updated = 0;                  
volatile char Timer1_Overflow = 0;
volatile unsigned char channel = 0;
volatile int Amb_Sensor_1 = 0, Amb_Sensor_2 = 0, Amb_Sensor_3 = 0, Amb_Sensor_4 = 0;
volatile int Sensor_1 = 0, Sensor_2 = 0, Sensor_3 = 0, Sensor_4 = 0;
volatile int Initial_1 = 0, Initial_2 = 0, Initial_3 = 0, Initial_4 = 0;
volatile int New_PWM1 = 0, New_PWM2 = 0, New_PWM3 = 0, New_PWM4 = 0;              
volatile int Old_PWM1 = 0, Old_PWM2 = 0, Old_PWM3 = 0, Old_PWM4 = 0;

unsigned char buffer = 8;

int main(void)
{
 DDRB = 0xff;
    //make sure IR emitters are turned off, and PWM 3
    PORTB &= ~((1 << 7)|(1 << 6)|(1 << 5)|(1 << 4)|(1 << 3));              
    DDRC = 0x00;                    //make PORT C inputs
  
    DDRD = 0xff;
    PORTD = 0x00;                    //set all of PORT D low. ensures
      
    Init_ADC();

    sei();
  
    Calibrate_Sensors();

    PORTD |= (1 << PWM1);            //blink to indicate end of Calibration
    _delay_ms(600);
    PORTD &= ~(1 << PWM1);

    Init_Timer0();
    Init_Timer2();

    //Init_I2C_Slave_Rx();

    while(1)
        {
            //do something?
            //. . .
        }

}

ISR(TIMER1_OVF_vect) 
    {
        Timer1_Overflow++;            //increment timer overflow variable
      
        switch(Timer1_Overflow)
            {
                case 1:                  
                    A2D_Channel_Select(0);                            //select ADC channel 0
                    Amb_Sensor_1 = ADC_read();                 //take ambient IR sensor reading
                    IR_1_ON;                                                        //turn on IR 1 LED, PORTB |= (1<<4)
                    Delay();                                                           //delay for the IR receiver to settle
                    Sensor_1 = ADC_read();                            //take active ADC reading of IR receiver
                    IR_1_OFF;                                                       //turn off IR 1 LED  

                    New_PWM1 = (Sensor_1 - Amb_Sensor_1) - Initial_1;    //condition readings
                    if(New_PWM1 <= 0)    { New_PWM1 = 0; }                //prevent negative numbers
                   
  New_PWM1 = ((7*Old_PWM1)>>3) + (New_PWM1>>3);    
 
                    if(OCR0A >= 1)    {DDRD |= (1 << PWM1);}
                    else { DDRD &= ~(1 << PWM1); }                        //turn off LEDs completely
                      New_PWM1 <<= 2;                                 
                   
                    if(New_PWM1 > 255)    { New_PWM1 = 255; }
                    OCR0A = New_PWM1;
                    New_PWM1 >>= 2;
                   
    /*****        //Trigger sequence
                    if(New_PWM1 > Initial_1)
                        {
                            DDRD |= (1 << PWM1);

                            if(OCR0A < 255)  
                                {
                                    OCR0A += (255 - OCR0A)>>2 ;
                                    //OCR0A++;
                                }

                            if (New_PWM1 < (Initial_1 + 8))
                                {
                                    Initial_1 = ((7*Initial_1)>>3) + (New_PWM1>>3);
                                }
                        }

                    else if(New_PWM1 < Initial_1)
                        {
                            if(OCR0A > 0)  
                                {
                                    OCR0A -= (OCR0A >> 4)+1;
                                    //OCR0A--;
                                }
                            else if(OCR0A <= 0)  
                                {
                                    DDRD &= ~(1 << PWM1);
                                }
                        }          
               *****/  
                    Old_PWM1 = New_PWM1;                      
                    break;
      
                case 2:
                    A2D_Channel_Select(1);                            //select ADC channel 1
                    Amb_Sensor_2 = ADC_read();
                    IR_2_ON;                                        //turn on IR 2 LED, PORTB |= (1<<5)
                    Delay();                                        //delay for the IR receiver to settle
                    Sensor_2 = ADC_read();                            //take ADC reading
                    IR_2_OFF;                                        //turn off IR 2 LED  

                    New_PWM2 = (Sensor_2 - Amb_Sensor_2) - Initial_2;
                    if(New_PWM2 < 0)    { New_PWM2 = 0; }
                  
                    New_PWM2 = ((7*Old_PWM2)>>3) + (New_PWM2>>3);
                    if(OCR0B >= 1)    {DDRD |= (1 << PWM2);}
                    else { DDRD &= ~(1 << PWM2); }

                    New_PWM2 <<= 2;
                    if(New_PWM2 > 255)    { New_PWM2 = 255; }
                    OCR0B = New_PWM2;
                    New_PWM2 >>= 2;
                /*
                    if(New_PWM2 > Initial_2)
                        {
                            DDRD |= (1 << PWM2);

                            if(OCR0B < 255)  
                                {
                                    OCR0B += (255 - OCR0B)>>2 ;
                                    //OCR0B++;
                                }

                            if (New_PWM2 < (Initial_2 + 8))
                                {
                                    Initial_2 = ((7*Initial_2)>>3) + (New_PWM2>>3);
                                }
                        }

                    else if(New_PWM2 < Initial_2)
                        {
                            if(OCR0B > 0)  
                                {
                                    OCR0B -= (OCR0B >> 4)+1;
                                    //OCR0B--;
                                }
                            else if(OCR0B <= 0)  
                                {
                                    DDRD &= ~(1 << PWM2);
                                }
                        }          
                    */
                    Old_PWM2 = New_PWM2;  
                    break;
                  
                case 3:
                    A2D_Channel_Select(2);                            //select ADC channel 2
                    Amb_Sensor_3 = ADC_read();
                    IR_3_ON;                                        //turn on IR 3 LED, PORTB |= (1<<6)
                    Delay();                                        //delay for the IR receiver to settle
                    Sensor_3 = ADC_read();                            //take ADC reading
                    IR_3_OFF;                                        //turn off IR 3 LED  

                    New_PWM3 = (Sensor_3 - Amb_Sensor_3) - Initial_3;
                    if(New_PWM3 < 0)    { New_PWM3 = 0; }
                  
                    New_PWM3 = ((7*Old_PWM3)>>3) + (New_PWM3>>3);
                    if(OCR2A >= 1)    {DDRB |= (1 << PWM3);}
                    else { DDRB &= ~(1 << PWM3); }
                    New_PWM3 <<= 2;
                    if(New_PWM3 > 255)    { New_PWM3 = 255; }
                    OCR2A = New_PWM3;
                    New_PWM3 >>= 2;
                /*
                    if(New_PWM3 > Initial_3)
                        {
                            DDRB |= (1 << PWM3);

                            if(OCR2A < 255)  
                                {
                                    OCR2A += (255 - OCR2A)>>2 ;
                                    //OCR2A++;
                                }

                            if (New_PWM3 < (Initial_3 + 8))
                                {
                                    Initial_3 = ((7*Initial_3)>>3) + (New_PWM3>>3);
                                }
                        }

                    else if(New_PWM3 < Initial_3)
                        {
                            if(OCR2A > 0)  
                                {
                                    OCR2A -= (OCR2A >> 4)+1;
                                    //OCR2A--;
                                }
                            else if(OCR2A <= 0)  
                                {
                                    DDRB &= ~(1 << PWM3);
                                }
                        }          
                    */
                    Old_PWM3 = New_PWM3;  
                    break;
                  
                case 4:
                    A2D_Channel_Select(3);                            //select ADC channel 3
                    Amb_Sensor_4 = ADC_read();
                    IR_4_ON;                                        //turn on IR 4 LED, PORTB |= (1<<7)
                    Delay();                                        //delay for the IR receiver to settle
                    Sensor_4 = ADC_read();                            //take ADC reading
                    IR_4_OFF;                                        //turn off IR 4 LED  

                    New_PWM4 = (Sensor_4 - Amb_Sensor_4) - Initial_4;
                    if(New_PWM4 < 0)    { New_PWM4 = 0; }
                  
                    New_PWM4 = ((7*Old_PWM4)>>3) + (New_PWM4>>3);
                    if(OCR2B >= 1)    {DDRD |= (1 << PWM4);}
                    else { DDRD &= ~(1 << PWM4); }
                    New_PWM4 <<= 2;
                    if(New_PWM4 > 255)    { New_PWM4 = 255; }
                    OCR2B = New_PWM4;
                    New_PWM4 >>= 2;
                /*
                    if(New_PWM4 > Initial_4)
                        {
                            DDRD |= (1 << PWM4);

                            if(OCR2B < 255)  
                                {
                                    OCR2B += (255 - OCR2B)>>2 ;
                                    //OCR2B++;
                                }

                            if (New_PWM4 < (Initial_4 + 8))
                                {
                                    Initial_4 = ((7*Initial_4)>>3) + (New_PWM4>>3);
                                }
                        }

                    else if(New_PWM1 < Initial_4)
                        {
                            if(OCR2B > 0)  
                                {
                                    OCR2B -= (OCR2B >> 4)+1;
                                    //OCR2B--;
                                }
                            else if(OCR2B <= 0)  
                                {
                                    DDRD &= ~(1 << PWM4);
                                }
                        }          
                */
                    Old_PWM4 = New_PWM4;
                  
                    Timer1_Overflow = 0;                    //reset                                      
                    Sensor_Values_Updated = 1;                //new values ready  
                      
                    break;      
            }//end switch
    }//end ISR


 

Why is this posted in the bugs section and why without any useful info to go along with it?
If you expect proper help than please include proper details first.

CulturalC (author)  Downunder35m22 days ago

thanks for responding i keep on getting these errors when i compile

> "make.exe" all

-------- begin --------
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Linking: tables.elf
avr-gcc -mmcu=atmega48a -I. -gdwarf-2 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=tables.o -std=gnu99 -MMD -MP -MF .dep/tables.elf.d tables.o --output tables.elf -Wl,-Map=tables.map,--cref -lm
tables.o: In function `__vector_13':
C:\table/tables.c:119: undefined reference to `A2D_Channel_Select'
C:\table/tables.c:120: undefined reference to `ADC_read'
C:\table/tables.c:122: undefined reference to `Delay'
C:\table/tables.c:123: undefined reference to `ADC_read'
C:\table/tables.c:173: undefined reference to `A2D_Channel_Select'
C:\table/tables.c:174: undefined reference to `ADC_read'
C:\table/tables.c:176: undefined reference to `Delay'
C:\table/tables.c:177: undefined reference to `ADC_read'
C:\table/tables.c:225: undefined reference to `A2D_Channel_Select'
C:\table/tables.c:226: undefined reference to `ADC_read'
C:\table/tables.c:228: undefined reference to `Delay'
C:\table/tables.c:229: undefined reference to `ADC_read'
C:\table/tables.c:276: undefined reference to `A2D_Channel_Select'
C:\table/tables.c:277: undefined reference to `ADC_read'
C:\table/tables.c:279: undefined reference to `Delay'
C:\table/tables.c:280: undefined reference to `ADC_read'
tables.o: In function `main':
C:\table/tables.c:89: undefined reference to `Init_ADC'
C:\table/tables.c:93: undefined reference to `Calibrate_Sensors'
C:\table/tables.c:99: undefined reference to `Init_Timer0'
C:\table/tables.c:100: undefined reference to `Init_Timer2'
make.exe: *** [tables.elf] Error 1

> Process Exit Code: 2
> Time Taken: 00:00