Hey,
This is my first post in forum. I was trying to take part in LFR competition but I was unable to complete the robot. I was trying use to RC car as robot. I used IR led and photo-diodes for input, l293d h-bridge IC for steering the front dc motor of RC car, PWM for speed controller of back DC motor, PIC18f2550 as microcontoller and C18 compiler.
The problem I faced is that My pic doesn't show any voltage output as input changes.
Here is my program for steering to h-bridge. If that would have worked then I have gone for speed control on turning.
#pragma FOSC = HSPLL_HS
# define STRA PORTBbits.RB0
# define STRB PORTBbits.RB1
ADCON1 = 0XFF;
TRISA = 0XFF;
TRISB = 0X00;
void main()
{
while(1)
{
if(PORTA == 0x00)
{STRA = 0; STRB=0;}
else if(PORTA == 0x01)
{STRA = 1; STRB=0;}
else if(PORTA == 0x03)
{STRA = 1; STRB=0;}
else if(PORTA == 0x02)
{STRA = 0; STRB=0;}
else if(PORTA == 0x06)
{STRA = 0; STRB=1;}
else if(PORTA == 0x04)
{STRA = 0; STRB=1;}
else if(PORTA == 0x07)
{STRA = 0; STRB=0;}
}
}