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 330 Ohm resistors.
// One Red LED with 330 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-4.
// Setup a push-button on digital pin-7. Configure analog pin A0 as a digital output pin for
// Green LED. Configure analog pin A1 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 push-button is pushed. Inside trap while loop, clear LCD and set both LEDs Off.
//
// After exit trap while loop, set row =0. Turn On Green LED. Turn Off Red LED.
//
// Enter for loop, initialize column to zero, loop until column number >15. Inside for loop:
// clear LCD, Set cursor position to current Column, row position, Print char letter to LCD,
// delay 0.5 seconds, end for loop
//
// After exit for loop, set row =1. Turn Off Green LED. Turn On Red LED.
//
//
//
// Enter another for loop, initialize column to zero, loop until column number >15. Inside for loop:
// clear LCD, Set cursor position to current Column, row position, Print char letter to LCD,
// delay 0.5 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 =0; // start row zero, top row
// unsigned int col =0; // start column zero, left column
//
//
// setup()
//
// call LCD begin function, configure as 16 columns by 2 rows LCD
// call LCD clear function, clear LCD
//
// set digital pin 7 as input pullup
// set analog input pin A0 as digital output, Green LED
// set analog input pin A1 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 =0(top LCD row)
// turn On Green LED
// turn Off Red LED
//
//
// for loop, col =0, col <16, col++
// clear LCD
// set cursor position to col, row
// print char letter
// delay 0.5 sec
// end for loop
//
//
// row =1
// turn Off Green LED
// Turn On Red LED
//
//
// for loop, col =0, col <16, col++
// clear LCD
// set cursor position to col, row
// print char letter
// delay 0.5 sec
// end for loop
//
// end loop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!