SunFounder ESP32 Starter Kit
Code
Note:
• You can open the file 6.3_reversing_aid.ino under the path of esp32-starter-kit-main\c\codes\6.
3_reversing_aid directly.
• After selecting the board (ESP32 Dev Module) and the appropriate port, click the Upload button.
• Always displaying “Unknown COMxx”?
• The LiquidCrystal I2C library is used here, you can install it from the Library Manager.
After the code is successfully uploaded, the current detected distance will be displayed on the LCD. Then the buzzer
will change the sounding frequency according to different distances.
Note: If the code and wiring are correct, but the LCD still fails to display any content, you can adjust the potentiometer
on the back to increase the contrast.
How it works?
This code helps us create a simple distance measuring device that can measure the distance between objects and provide
feedback through an LCD display and a buzzer.
The loop() function contains the main logic of the program and runs continuously. Let’s take a closer look at the
loop() function.
116 Chapter 1. For Arduino User