0% found this document useful (0 votes)
4 views4 pages

Chapter 7

The document contains three Arduino C programs for different tasks involving LCD displays. The first program displays the analog to digital conversion result from pin A2, the second scrolls the text 'Scroll' on a 16x2 LCD, and the third displays a custom character on a 20x1 LCD. Each program is designed without comments and utilizes specific pin configurations for the LCD connections.

Uploaded by

khatidenickese
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Chapter 7

The document contains three Arduino C programs for different tasks involving LCD displays. The first program displays the analog to digital conversion result from pin A2, the second scrolls the text 'Scroll' on a 16x2 LCD, and the third displays a custom character on a 20x1 LCD. Each program is designed without comments and utilizes specific pin configurations for the LCD connections.

Uploaded by

khatidenickese
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Chapter 7: 6, 8, 9

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

LiquidCrystal lcd (10 , 11, 4, 5, 6, 7);

int iValue = 2023;

void setup

lcd.begin ( 16,1);

lcd.setCursor ( 0,0); lcd.print

("A 2 Result:"); lcd.print

(iValue , DEC ); delay(500);

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>

LiquidCrystal lcd (8, 9, 4, 5, 6, 7); void

setup ()

lcd.begin ( 16,2);

lcd.print ("Scroll");

void loop ()
{

for(int i =0; i <10; i ++)

lcd. scrollDisplayRight ();

delay(500);

for(int i =0; i <10; i ++)

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

LiquidCrystal lcd (8, 9, 4, 5, 6, 7); / byte

outsidePerimeter[8] = { B01110,

B10001,

B10001,

B10001,

B10001,

B10001,

B10001,

B01110

};

void setup ()

lcd.createChar (0,outsidePerimeter);

lcd.begin (20, 1);

lcd.write (byte (0));

}
void loop () {}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy