Hi there! I want to return the sonar.distance as distance, but if I check if the distance is less then 5 cm my steppermotor doesnt react to this
Hello , You shouldn't have a function named sonar if you already have something else named sonar. That could create problems. To your question: at what point do you want the sonar function to return? It looks like you want it to keep checking the distance repeatedly forever.