Sorry
I was in a hurry when I posted this. Let me repost it.
Ok.
The Flex sensor is connected to the analog Pin Via a Pull up Resistor. I get around 103 when it is straight and around 225 when it is bent. It works pretty well. (5k and 10k were in Ohms. I was not specific in last post. Sorry again).
The motors are connected to L293D and two of the inputs are given to the PWM pins in the controller. Forward and Backward are controlled by 0,1 inputs.
What I did.
Is really the basics.
I assumed a value of 150
If (analogValue > 150){
digitalWrite(m1,HIGH);
digitalWrite(m2,LOW);
Delay(1000);
}
If (analogValue < 150){
digitalWrite(m1,LOW);
digitalWrite(m2,HIGH);
Delay(1000);
}
"Do you know how to make things happen for specific periods of time?"
Without Delay? No, I don't. Could you please let me know how to do it.