have itegrated the car by using DC motor(for moving the car forward and backward) and stepper motor(for moving the car right and left)
and i start to write the code (borland C++) i have wrote the code for moving the car forward and backward , but am facing problem for writing the code for moving the car left and right (the code i wrote is followed), plz try to help as soon as u can am really in need for ur help to complete the code..............
thank u very much and this is my code :
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)
void f();
void r();
void main()
{
while(1)
{
if( input_a()==0x01)
f();
else if(input_a()==0x02)
r();
}
}
void f()
{
output_b(0x01);
delay_us(10);
output_b(0x02);
delay_us(10);
output_b(0x04);
delay_us(10);
output_b(0x08);
delay_us(10);
}
void r()
{
output_b(0x08);
delay_us(10);
output_b(0x04);
delay_us(10);
output_b(0x02);
delay_us(10);
output_b(0x01);
delay_us(10);
}
#include <16f877a.h>