Programming Arduino Getting Started with Sketches


# , then the sketch clears the whole display, and if the character is a  /



Yüklə 5,42 Kb.
Pdf görüntüsü
səhifə65/78
tarix22.12.2023
ölçüsü5,42 Kb.
#189286
1   ...   61   62   63   64   65   66   67   68   ...   78
Arduino SimonMonk 2011

#
, then the sketch clears the whole
display, and if the character is a 
/
, the sketch moves to the second line. Otherwise, the
sketch simply displays the character at the current cursor position using 
write
. The
function 
write
is like 
print
, but it prints only a single character rather than a string of
characters.
Using the Display
Try out sketch 9-01 by uploading it to the board and then attaching the shield. Note that
you should always unplug the Arduino board so that it is off before you plug in a shield.
Open up the Serial Monitor and try typing in the text shown in 
Figure 9-3
.


Figure 9-3
Sending commands to the display
Other LCD Library Functions
In addition to the functions that you have used in this example, there are a number of other
functions that you can use:
• home
is the same as 
setCursor(0,0)
: it moves the cursor to top-left.
• cursor
displays a cursor.
• noCursor
specifies not to display a cursor.
• blink
makes the cursor blink.
• noBlink
stops the cursor from blinking.
• noDisplay
turns off the display without removing the content.
• display
turns the display back on after 
noDisplay
.
• scrollDisplayLeft
moves all the text on the display one character position to the left.
• scrollDisplayRight
moves all the text on the display one character position to the right.
• autoscroll
activates a mode in which, as new characters are added at the cursor, the
existing text is pushed in the direction determined by the functions 
leftToRight
and

Yüklə 5,42 Kb.

Dostları ilə paylaş:
1   ...   61   62   63   64   65   66   67   68   ...   78




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin