hii...
i am doing a project n while compiling it shows a single error written underneath
"../ballista123.c:3:31: error: compact\deprecated.h: No such file or directory "
can anyone please help me out to sort out this problem....it's really very urgent...
m using atmega16.. using IDE is avrstudio4....
#include<avr\io.h>
#include<util\delay.h>
#include<compact\deprecated.h>
#include<inttypes.h>
#define SETBIT(a,b) a|=(1<<b)
//#define CLEARBIT(a,b) a&=(1<<b)
volatile int r1,r2;
unsigned char ch , pincc;
void settimer()
{
TCCR1A=0b10100001;
TCCR1B= 0b00001001;
TCCR0=0b01101011;
}
void forward()
{
cbi(PORTC,1);
sbi(PORTC,2);
cbi(PORTC,3);
sbi(PORTC,4);
}
void reverse()
{
sbi(PORTC,1);
cbi(PORTC,2);
sbi(PORTC,3);
cbi(PORTC,4);
}
void rightturn()
{
sbi(PORTC,1);
cbi(PORTC,2);
cbi(PORTC,3);
cbi(PORTC,4);
}
void leftturn()
{
cbi(PORTC,1);
cbi(PORTC,2);
sbi(PORTC,3);
cbi(PORTC,4);
}
void shiftleft1() // to shift bot to more amount in clockwise direction
{
volatile int i;
ch=00001;
for(i=0;i<3;i++)
{
ch=ch<<i;
leftturn();
_delay_ms(1);
}
forword();
}
void shiftleft2() // to shift bot to slightly less amount in clockwise direction
{
ch=00011;
volatile int i;
for(i=0;i<2;i++)
{
ch=ch<<i;
leftturn();
_delay_ms(1);
}
forward();
}
void shiftleft3()
{
ch=00010;
volatile int i;
for(i=0;i<1;i++)
{
ch=ch<<i;
leftturn();
_delay_ms(1);
}
forward();
}
void shiftright1() // to shift bot to more amount in anti-clockwise direction
{
ch=10000;
volatile int i;
for(i=0;i<3;i++)
{
ch=ch>>i;
rightturn();
_delay_ms(1);
}
}
void shiftright2() // // to shift bot to slightly less amount in anti-clockwise direction
{
ch=01000;
volatile int i;
for(i=0;i<2;i++)
{
ch=ch>>1;
rightturn();
_delay_ms(1);
}
}
void shiftright3()
{
volatile int i;
ch=00100;
for(i=0;i>1;i++)
{
ch=ch>>i;
_delay_ms(1);
rightturn();
}
}
void found_intersection()
{
_delay_ms(50);
forward();
}
void read_sensor()
{
pincc=PINC;
while(1)
{
if((pincc==00111000) || (pincc==00010000))
{
OCR1A=180;
OCR1B=180;
forward();
}
else if((pincc==00011000) ||(pincc==00001000) || (pincc==00011100))
{
//n=2;
OCR1A=120;
OCR1B=120;
shiftleft3();
_delay_ms(2);
forward();
}
else if(pincc==00001100)
{
//n=3;
OCR1A=90;
OCR1B=90;
shiftleft2();
_delay_ms(2);
forward();
}
else if(pincc==00000100)
{
//n=4;
OCR1A=70;
OCR1B=70;
shiftleft1();
_delay_ms(2);
forward();
}
else if((pincc==01111100) || (pincc==00111100) || (pincc==01111000))
{
found_intersection();
}
else if((pincc==00110000) || (pincc==01110000) || (pincc==00100000))
{
OCR1A=120;
OCR1B=120;
shiftright3();
_delay_ms(2);
forward();
}
else if(pincc==01100000)
{
OCR1A=90;
OCR1B=90;
shiftright2();
_delay_ms(2);
forward();
}
else if(pincc==01000000)
{
OCR1A=70;
OCR1B=70;
shiftright1();
_delay_ms(2);
forward();
}
else
;
}
}
void see_wall()
{
break_move();
{
sbi(PORTC,1);
sbi(PORTC,2);
sbi(PORTC,3);
sbi(PORTC,4);
}
}
/*void set_pwm(volatile int left_spd , volatile int right_spd)
{
OCR1A=left_spd;
OCR1B=right_spd;
}
*/
void main(void)
{
DDRA=0x00;
PINA=0x00;
SETBIT(DDRC,0);
SETBIT(DDRC,1);
SETBIT(DDRC,2);
SETBIT(DDRC,3);
SETBIT(DDRC,4);
SETBIT(DDRC,5);
SETBIT(PORTC,0);
SETBIT(PORTC,1);
SETBIT(PORTC,2);
SETBIT(PORTC,3);
SETBIT(PORTC,4);
SETBIT(PORTC,5);
settimer();
_delay_ms(100);
OCR1A=180;
OCR1B=180;
forward();
while(1)
{
if(PINA==00000000)
{
exit(0);
}
else
{
forward();
_delay_ms(50);
read_sensor();
_delay_ms(50);
}
}
}