Sketch
In this chapter, we use GPIO32 of ESP32 as the Trig pin of the ultrasonic module, and GPIO12 as the Echo pin
of the ultrasonic module.
Open “Sketch_05_Ultrasonic” folder in “Freenove_Robot_Dog_Kit_for_ESP32\Sketches” and then double-
click “Sketch_05_Ultrasonic.ino”.
Sketch_05_Ultrasonic
Upload the sketch to ESP32 and the robot will acquire ultrasonic data every 500 milliseconds and prints
them out through the serial port.