1: Wire The HC-SR04 Ultrasonic Sensor
- Connect the
VCC
andGND
to the5V
andGND
on the Arduino Nano Respectivly - Connect the
Trig
to theD12
pin on the Arduino Nano - Connect the
Echo
to theD11
pin on the Arduino Nano
2: Wire the OLED LCD Module via i2c
- Connect the
VCC
andGND
to the5v
andGND
pins on the Arduino Respectivly - Connect the
SCL
to pinA5
on the Arduino - Connect the
SDA
to pinA4
on the Arduino
3: Download and Open Code
-
Download and Extract this repository to any folder on your PC
-
Download and Open Arduino IDE
-
In the IDE go to
Sketch
,Include Library
, thenAdd .ZIP Library
-
Locate the Folder you downloaded and extracted this repository to, and load all the libraries in the
libraries
folder -
Load all 4 Libraries in the IDE
-
Then Location the Code in the
OLED_Ultrasonic
Folder, and double click to open it or go toFile
,Open
in the IDE
4: Run the code