1 vote

Motor with ultrasonic sensor

You can do something along the line of if (distance < 5) { digitalWrite (motorpin1, LOW); } else { digitalWrite (motorpin1, HIGH); } It seems like you only set motorpin2 to LOW and never ...
  • 164

Only top scored, non community-wiki answers of a minimum length are eligible