Thanks everybody.
I'll stick with it, and will try to do the flowchart.
But for motor control, whick is more flexible:
PWM? or using 1/0 signals to trigger a mosfet to turn on the two motors for two wheel?
I've understood clearly for two sensors, But when it comes to multiple sensors(ie 6-8), how does the algorithm change.is it like :
When the Left most sensor triggers, then the right motor turns most, when the next left sensor trigger, then the right motor turns a little than the previous...and so on.