Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

line follower robot program

Status
Not open for further replies.

UnD3aD

New Member
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
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top