Go Down

Topic: control dc motor via ultrasonic distance module and L298 motor driver (Read 3864 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.
Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums
Pas de messages priv├ęs SVP

Go Up