go away spammer

Author Topic: urgent urgent....  (Read 2214 times)

0 Members and 1 Guest are viewing this topic.

Offline subhechhaTopic starter

  • Jr. Member
  • **
  • Posts: 18
  • Helpful? 0
urgent urgent....
« on: January 26, 2011, 01:48:51 AM »
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....
Code: [Select]
#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);

}
}
}
« Last Edit: January 26, 2011, 02:04:02 AM by subhechha »

Offline Hawaii00000

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 347
  • Helpful? 2
Re: urgent urgent....
« Reply #1 on: January 26, 2011, 02:03:24 AM »
Your going to have to give us the code.
"God chose to make the world according to very beautiful mathematics."
-Paul Dirac
**************************************************************
Its Hawaii Five-O. Get it?

Offline subhechhaTopic starter

  • Jr. Member
  • **
  • Posts: 18
  • Helpful? 0
Re: urgent urgent....
« Reply #2 on: January 26, 2011, 02:05:10 AM »
ya have given plz go through it
plzz

paulstreats

  • Guest
Re: urgent urgent....
« Reply #3 on: January 26, 2011, 03:38:02 AM »
the part at the top of the code is where you include some other files to help mae your project work. The computer cant find the file called "deprecated.h", you should either find the file and change the 3rd line in your code to point to it or just delete that line and see if it works without it. (things get called deprecated when they are no longer used or have been replaced by a better version, so if you are including a file called deprecated there is a good chance that you just dont need it)

 


Get Your Ad Here

data_list