Professional Documents
Culture Documents
CONSTRUCTION WITH
ARDUINO
NECESSARY MATERIALS
Arduino Nano
16 × 2 LCD I2C Display
Ultrasonic Sensor
9v Jack Cable
Mini Breadboard
3D Printing Parts (download)
Why Ultrasonic Sensor? Ultrasonics is reliable in any lighting
environment and can be used
moving too often without being too fast. Ultrasonic applications are widely
used and can be
#include <NewPing.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
void setup() {
lcd.begin();
lcd.backlight();
lcd.print("distance:");
}
void loop() {
delay(50);
lcd.setCursor(0,1);
lcd.print(sonar.ping_cm() );
lcd.print(" cm");
}
<pre>