line follower
hey i got one doubt in the given program, in while loop ,there is
if((P1_0==0)&&(P1_4==1))
TurnRight();
else if((P1_0==1)&&(P1_4==0))
TurnLeft();
else
Forward();
when p1_0==0 left sensor will b off and when p1_4==1 right sensor works and it rotates then it should take left turn..am i right?
if wrong plzz..xplain me..











http://www.botskool.com/images/elec/ioi87.jpg
the image shows 2 LED circuit.
Are these for emitter and reciever?
and are they only sufficient circuit for emitter and reciever? ( I bought emitter and detector from a shop
and he gave me a circuit with 2 led + 1 resistor+input pins.)
Thanx shashwat sir for the valuable advise.
i love this online compiler....as a student it really helps me ...my teacher was impress with me ...
Yes you can use L293B also.
what is the value of the pot
hi can we use l293d instead of l293b
hai ther i program it ready...but my robot not working...why...ther is NO output from the 8051..when i used multimeter to check the output of the p0.0,p0.1,p0.2,p0.3,p0.4,p0.5..ther is only got voltage in port p0.0 and p0.4...others all it jus show 0v.....as i know the po.0 and p0.4 is the ENABLE port rite for L293 chip...why????
sivan
ok...i understand.....ok lets say i wan to modify the given code.bcos i wan make it to avoid things..
as in the link below plz c the video and suggest me a idea what can i do to make it like that and its that i need to change the header or only the source code..
http://www.youtube.com/watch?v=kBKhaMfIGbs
sivan
You are welcome.
See the terms used in code such as P0_0 (pin 0 of port 0), P0_1 (pin 1 of port 0) etc these are all microcontroller related specific terms and compiler doesn't recognize them by default. So like normal variables they have to be defined somewhere. In this case all the terms related to AT89S52 microcontroller are defined in this header file. Thats why it is necessary to include this header file.
thanks you very much....ok i jus wan to know ..whats the used of the .H (header file)...can u explain me why....let say i wan to modify this program bcos wan to do line follower avoiding obstacle.....
sivan
Download Keil C IDE and then compile your code. Follow this link - http://www.keil.com/demo/eval/c51.htm.
Also you have mentioned that you are unable to download hex file. To download it right click on the hex file link given on line follower tutorial page and choose Save Link As/Save Target As option.
i need ur valueble HELPS
sivan
ok....can u help me to compiler the .c and send to my mail " weird_c1@yahoo.com " so at least i can burn it in to my microcontroler so that i can check out my robot can work or not..can ah
sivan
DEVc++ ...... yar it in same folder...
sivan
Hi sivan000,
The linefollower.c file and hex file should be in the same folder. Which compiler are you using?
Download the Keil C compiler from here - http://www.keil.com/demo/eval/c51.htm
If its really urgent then you can also directly download the hex file from line follower tutorial page.
its still saying the same problem........why...i dun understand ...i never modify anything only i jus download it and try to compiler it..but cn nt....is that my compiler problem...its like that mean ,,cn u suggest me any web to download it nw!!...plzzz help ME
sivan
mean i jus download both of it...and jus put it in my desktop and try to compile it rite
sivan
You need to include AT89X52.h header file. Download it from line follower tutorial webpage and place it in C:\Users\chuan\Desktop and then try and compile your program again.
i have tried also ..but the error it say sumthing like this
C:\Users\chuan\Desktop\linefollower.c:70: warning: return type of 'main' is not `int'Execution terminated
so whats the problem..i dun understand how to included the header file - AT89X52.h...
i hv download both .H and .C but i cn nt download the .hex file
sivan
Hi sivan000,
I tried compiling the code and it compiled successfully. Have made any modifications to the code? Make sure that you have included the header file - AT89X52.h.
You can also directly download the hex file given in line follower tutorial.
i think there is sum problem in sum were in c or my computer...so cn i get the .hex file can any wan compiler it and give me...cn do it like tat ah....bcos i need it as fast as can ...u guys realy helpful ......
sivan
realy thanks for ur help....but went i compiler the c file its show sum error, why ah..and whats the used of the h(header) file the given....
sivan
Use the linefollower.c file in C compiler IDE like kiel c software, which will generate a .hex file .. use this hex file to program your micro controller. Thats all. The c code is correct. Hope it helps
hey guyz i got a problem....based on this webpage i have created a line follower robot exactly.The problem is now that i am not sure whats the use of the three file below and which one of the following files should i burn into my microprocessor chip.My knowledge in programming is just basic. After compiling the source code given (linefollower.c).Is the given program correct or there is any problem....Pls help me as soon as possible anyone.
Download c program file - linefollower.c
Download hex file – linefollower.hex
Download AT89X52.h header file
sivan
Hi srivardhan,
This code is for bOt following a white line on black surface. So the condition (P1_0==0)&&(P1_4==1) implies that left sensor is on black surface and right sensor is on white line right now i.e. the bOt is drifting to left hand side. To correct this we need to take a right turn and hence the TurnRight() function has been called.