Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Robotics Chat


Robotics Chat Specific to discussions about robots and the making of.

Reply
 
Tools
Old 27th March 2005, 10:59 AM   #1
Default line follower robot program

Code:
#include <system.h>

void main()
{
trisa = 00b;
trisb = 111b;
porta = 00b;
while(1){
switch(portb)
{
case 100b: porta = 10b;break;
case 110b: porta = 10b;break;
case 010b: porta = 11b;break;
case 011b: porta = 01b;break;
case 001b: porta = 01b;break;
case 000b: porta = 00b;break;
case 111b: porta = 00b;break;
}
}
}
this program will work for a line follower robot? or i should use intrerupts? i didn't build my programmer yet and i can't test it...

trisb from line sensors and trisa to motors
UnD3aD is offline  
Old 29th March 2005, 08:47 PM   #2
Default

it could work, but if i were you i would try to use control theory to get smooth operation:

http://elm-chan.org/works/ltc/report.html

/Johan
strombom is offline  
Old 23rd October 2007, 09:14 AM   #3
Default

you should use interrupt to enable the robot to change the speed of each wheel, that way you'd get smoother turnings
forever99482 is offline  
Reply

Tags
follower, line, program, robot

Thread Tools
Display Modes




All times are GMT. The time now is 11:32 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker