Question: / / Hardware: One button with GPIO pullup resistor. / / One Green LED with 3 3 0 Ohm resistors. / / One Red LED
Hardware: One button with GPIO pullup resistor.
One Green LED with Ohm resistors.
One Red LED with Ohm resistors.
The LCD with variable resistor to control brightness of backlight
Problem Statement: Build an Arduino project that uses the LCD. Setup the LCD according to Lab
Setup a pushbutton on digital pin Configure analog pin A as a digital output pin for
Green LED. Configure analog pin A as a digital output pin for Red LED.
Create a global constant char variable for a letter, use first letter of first name.
Create two global unsigned int variables, one for LCD row row one for LCD column col
When program loop function starts, it will be trapped in a while loop, until
the pushbutton is pushed. Inside trap while loop, clear LCD and set both LEDs Off.
After exit trap while loop, set row Turn On Green LED. Turn Off Red LED.
Enter for loop, initialize column to zero, loop until column number Inside for loop:
clear LCD, Set cursor position to current Column, row position, Print char letter to LCD,
delay seconds, end for loop
After exit for loop, set row Turn Off Green LED. Turn On Red LED.
Enter another for loop, initialize column to zero, loop until column number Inside for loop:
clear LCD, Set cursor position to current Column, row position, Print char letter to LCD,
delay seconds, end for loop
End loop function
Pseudocode Algorithm
include LiquidCrystal.h header file show program where LCD functions are and where located
call LiquidCrystal LCD function to setup LCD pins
Global Constants: can not change value during program execution constant
const char letter L; char L from Leslie
Global Variables: can change value any time in program variable
unsigned int row ; start row zero, top row
unsigned int col ; start column zero, left column
setup
call LCD begin function, configure as columns by rows LCD
call LCD clear function, clear LCD
set digital pin as input pullup
set analog input pin A as digital output, Green LED
set analog input pin A as digital output, Red LED
end setup function
loop
while digitalRead high do nothing while button not pushed
clear LCD
turn Off Green LED
turn Off Red LED
end trap while loop
row top LCD row
turn On Green LED
turn Off Red LED
for loop, col col col
clear LCD
set cursor position to col, row
print char letter
delay sec
end for loop
row
turn Off Green LED
Turn On Red LED
for loop, col col col
clear LCD
set cursor position to col, row
print char letter
delay sec
end for loop
end loop
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
