Chapter 7
Chapter 7
Question 6
Develop an Arduino C program without comments that displays the analog to digital conversion result of
pin A 2 on a text based LCD Only four LCD data lines are connected to Arduino pins 4 to 7 The LCD
register select is connected to pin 10 and the LCD enable line is connected to pin 11 If a sixteen by one
line LCD is used, display the following fixed text on LCD “A 2 Result:”. Straight after this fixed text
continually display the maximum four digit decimal conversion result, every half second.
Answer
#include LiquidCrystal .h
void setup
lcd.begin ( 16,1);
void loop () {}
Question 8
Create an Arduino C program without comments that initially displays “Scroll” fixed text on the first line
of a sixteen by two line LCD. There afterwards, every second scrolls the display right ten times and then
every half second scrolls the display left ten times, continuously Only four LCD data lines are connected
to Arduino pins 4 to 7 The LCD register select is connected to pin 8 and the LCD enable line is connected
to pin 9.
Answer
#include <LiquidCrystal.h>
setup ()
lcd.begin ( 16,2);
lcd.print ("Scroll");
void loop ()
{
delay(500);
lcd.scrollDisplayLeft ();
delay(250);
Question 9
Design an Arduino C program without comments to display a custom character 5 x 8 pixel glyph of an
outside perimeter as shown below on the first line of a twenty by one line LCD. The LCD register select
pin is connected to pin 2 and the LCD enable pin is connected to pin 3 while only four LCD data lines are
connected to Arduino pins 8 to 11.
Answer
#include LiquidCrystal .h
outsidePerimeter[8] = { B01110,
B10001,
B10001,
B10001,
B10001,
B10001,
B10001,
B01110
};
void setup ()
lcd.createChar (0,outsidePerimeter);
}
void loop () {}