Documente Academic
Documente Profesional
Documente Cultură
In a serial monitor, the text and information that is printed into it must be seen on a
computer. While this is useful if a computer is readily available, this can not always work. If the
arduino is connected to an external power source and a computer is not attached, then no
information can be seen. This is when the LCD becomes useful as it can display information
when only connected to a power source. The LCD does have its limitations because it can only
display a certain number of characters
There were some challenges while using the LCD with an arduino. The LCD was hard to
connect to the arduino as it has a lost of wires and needed to be imputed into many different
digital pins. Additionally, initializing from LiquidCrystal was hard as you had to make sure the
ports in the code lined up with the actual hardware.
Ultrasonic Sensor:
An ultrasonic sensor is a device that measures distance by sending sound waves. It
works by sending pulses of sound out of one part of the device, and then it senses how long it
takes for that wave to get back to the device after hitting an object. The trig pin is the part of the
sensor that sends the sound waves out while the echo pin is the part of the sensor that receives
the sent out sound waves.
There are a couple main commands to use for the ultrasonic sensor. First, the trigPin
must be set to sound out information (pinMode(trigPin,OUTPUT);) while the echoPin must me
set to receive input from the trigPin(pinMode(echoPin,INPUT);). Next, the arduino must tell the
trigPin when to send out the pulses(digitalWrite(trigPin,LOW/HIGH);). The trig pin needs to be
switch from off(low) to on(high) to off(low). In between each of these, a delay is necessary to
allow the sensor to work properly. Turning the trigPin on and off causes it to pulse, which allows
the echoPin to receive the pulses and find out the time it takes for the sound wave to travel back
to the echoPin.