Obstacle avoiding robot - Microcontroller Programming

guys i m makin an obstacle avoidng robot with 2 dc geared motors, a sharp ir sensor, nd nxp microcontroller p89v51rd2bn i m having problem in programmign de microcontroller . using keil i m making a hex file to burn the data into microprocessor . can u guys suggest me some programs code to make hex file i m having problem in tat

#include
#define forward 0x05; //0000 01 01 both motors in forward
#define reverse 0x0a; //0000 10 10 both motors in reverse
#define leftturn 0x06; //0000 01 10 left motor =backwards,
//right motor=forward
#define rightturn 0x09; //0000 10 01 left motor=forward
//right motor=backwards
#define obst P2
void main()
{ int P1,P2;
P1=0xff; //intialize PORT1 as input(sensors)
P2=0x00; //intialize PORT2 as output(motors)
if(obst==0) //Check if sensor has detected an obstacle
{ P2=reverse;
P2=rightturn;
} else
{ P2=forward; //else go forward
}


this is my program i hav searched for but it is showing in keil tat header file cant be read ? why ? can u correct this program or suggest me some obstacle avoiding robo progams for my microprocessor

Replies

  • Shobhan Mankad
    Shobhan Mankad
    check if the header file that you have included the (.h) file is present within the Keil directory. if not you need to,

You are reading an archived discussion.

Related Posts

Google has introduced following games on Google+ : Angry Birds Bejeweled Blitz Zynga Poker Bubble Island City of Wonders Collapse Blast Diamond Dash Crime City Dragon AGe legends Dragon of...
Many more happy returns of the day Mahesh :myparty: 🎉🎉 Wish you a successful year ahead!! Where is the party?
The Ten Worst Things to Put in Your Cover Letter - Finance and Accounting Jobs News and Advice
i nee latest paper presentations on computer technologies.
i use many applications and softwares for my work. so my c drive space is insufficient for the programs to run and always showing a warning of 'low disk space'....