We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
#include<p89v51rd2.h>
#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 C CODE FOR OBSTACLE AVOIDING ROBOT BUT WHEN USING KEIL I CLICK ON BULIT TARGET IT IS SHOWING 1 WARNING THAT p89v51rd2.h CANT BE READ . PLZ GIVE ME ANSWER I HAV TO SUB,IT MY PROJECT AFTER 2 DAYS
If you are so beginner that you can't even use the Windows Explorer to check if you have a file with that name, then I think you should try something else.
Next thing - when a compiler fails to read a header file, it isn't exactly a nice warning. There is a significant difference between a warning and an error. An error is end-of-game. A warning is a report about a potential problem - it's up to you to check the severity.