Hi, I'm a newbie with Arduino and I wanted to ask how to write a code. I have connected 2 motors with l293d and need do a sequenze like this :
Read ultrasonic sensor (r=distance in cm )
if (r>4) motor 1 and motor 2 High else motor 1 OR motor 2 High for "t " seconds
when "t" seconds ends motor1 and motor 2 High
loop sequence .