Obstacle avoid robot micro controlling programming

 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

Comments

Popular posts from this blog

Albert Einstein

Evolution of Google Pay

How the man will be after 2040 and the earth will be?