![]() | ![]() | ![]() |
| | |||||||
| Robotics Chat Specific to discussions about robots and the making of. |
| | Thread Tools | Display Modes |
| | (permalink) |
| Experienced 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;
}
}
} trisb from line sensors and trisa to motors |
| | |
| | (permalink) |
| New Member | 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 |
| | |
| | (permalink) |
| Experienced Member | you should use interrupt to enable the robot to change the speed of each wheel, that way you'd get smoother turnings |
| | |