ESP32 Starter Kit
3. Wiring Diagram
4. Test Code
When parking, we can use the ultrasonic to know the situation of blind spots. In this project, lines displayed on the dot
matrix indicates the distance of the car.
/*
keyestudio ESP32 Inventor Learning Kit
Project 27 Intelligent Parking
http://www.keyestudio.com
*/
#include <LedControl.h>
int DIN = 23; //Define DIN pin to IO23
int CS = 15; //Define CS pin to IO15
int CLK = 18; //Define CLK pin to IO18
int temp = 0;
int distance = 0; //Define a variable to receive the distance
int EchoPin = 14; //Connect Echo pin to IO14
int TrigPin = 13; //Connect Trig pin to IO13
(continues on next page)
146 Chapter 8. Arduino Tutorial