hello everyone,I am trying to make a line following robot. I use continuous rotation servos, the problem is that the servos won't stop turning once started. This is because the code doesn't check the sensor output after the first time.

Thanks a lot!

I used this sensor: http://dx.com/p/arduino-line-hunting-sensor-module-118057and these servos: http://www.ebay.com/itm/clear-up-Spring-RC-SM-S4306R-360-Degree-Continuous-Rotation-Robot-Servo-SMS4306R-/350696583715?pt=US_Character_Radio_Control_Toys&hash=item51a7253223

Your comments say that the servos will be stopped with the speed value set to speed1, speed2 or speed3. It is very unlikely that they are all true bearing in mind the range of values this implies (61, 111 and 71)

Please do not send me PMs asking for help. Post in the forum then everyone will benefit from seeing the questions and answers.

Considering that digitalRead() can only return HIGH or LOW, if the value is not HIGH, is there any possible way that the value can be anything other than LOW?

If you come to the correct conclusion that there is not, then explain why you need to test for HIGH.

The if/else if(/else) construct is used to test multiple conditions when there could be more than two. The if/else construct is preferred when there are only 2 possible conditions (as in the case of digitalRead).