![]() | ![]() | ![]() |
| |||||||
| Robotics Chat Specific to discussions about robots and the making of. |
![]() |
| | Tools |
| | #1 |
| 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 | |
| |
| | #2 |
|
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 | |
| |
| | #3 |
|
you should use interrupt to enable the robot to change the speed of each wheel, that way you'd get smoother turnings
| |
| |
|
| Tags |
| follower, line, program, robot |
| Thread Tools | |
| Display Modes | |
| |