Dear all especially Steve.
I had design a line tracer robot for my college. My knowledge about micro controller is very basic that why a needs your help.
for you info.
pic 16F877A
' input
portb.1 = Left Sensor (LS)
portb.2 = Center Sensor (CS)
portb.3 = Right Sensor (RS)

iam using 3 photo sensor.

' Output
portb.4 = Left Motor FWD. (LM_FWD)
portb.5 = Left Motor REV. (LM_REV)
portb.6 = Right Motor FWD. (RM_FWD)
portb.7 = Right Motor REV. (RM_REV)

iam using "H" bridge to driving my 2 DC motor.
What i want to know is,
1. How to control the robot, like this operation

LS(0) CS(1) RS (0) LM_FWD(FULL SPEED) RM_FWD (FULL)
LS(1) CS(1) RS (0) LM_FWD(HALF SPEED) RM_FWD (FULL)
LS(1) CS(1) RS (0) LM_FWD(MIN SPEED) RM_FWD (MAX)
LS(0) CS(1) RS (1) LM_FWD(HALF) RM_FWD (MAX)
LS(0) CS(0) RS (1) LM_FWD(MAX SPEED) RM_FWD (MIN)

2. another things is how to control
if the 3 Sensor = 1 3 times cross 4 junction, the robot will stop and turn 90 deg left (for example)

which is easier using PWM or Pulseout?
Please guy help me.