Go Down

Topic: control dc motor via ultrasonic distance module and L298 motor driver (Read 4746 times) previous topic - next topic

jwong1234

Someone PLease Help
It says duration is unspecified for the code above

J-M-L

It's defined as a local variable in the loop()
void loop() {
// and the distance result in centimeters:
long duration, cm;   // <==== HERE
pinMode(trigPin, OUTPUT);
...
}


Post YOUR code using code tags.
Hello - Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums.
Bonjour Pas de messages privés SVP, postez dans le forum directement pour que ça profite à tous

Go Up