28029 Parallax Inc, 28029 Datasheet - Page 297

KIT PARTS SMART SENSORS W/TEXT

28029

Manufacturer Part Number
28029
Description
KIT PARTS SMART SENSORS W/TEXT
Manufacturer
Parallax Inc
Datasheet

Specifications of 28029

Accessory Type
Parts Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
BASIC Stamp® or Javelin Modules
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Other names
28029PAR
' -----[ Subroutines - Disp_Cust_Char ]---------------------------------------
' This subroutine displays a custom character.
' be set to either Line0 or Line1, and the cursor variable can be set
' to a value between 0 and 15.
' LCD's custom characters and should be set to a value between 0 and 7.
Disp_Cust_Char:
Your Turn - 31 Levels Covering Two Rows and Adding a Horizontal Axis
The
rowMap = %1111111100000000
value & %1111
value
the bar graph will behave the same way for values between 16 and 31 as it does for
values between 0 and 15, the bar graph can be placed either on the upper or lower line to
indicate which range the
1 to 31, with 16 showing no bars.
Modifying the program to display characters in this fashion involves just a few small
changes to the Main Routine. First, the
arguments have to be changed from (0 to 15) to (1 to 31). Also, a
to be added to overwrite the previous custom characters with blank spaces. Then, an
IF
Line 1. It must place the cursor on Line 0 when value is greater than 16, or on the lower
line when value is less than or equal to 16.
SEROUT LcdPin, T9600,
RETURN
...
THEN
command
is 31. It will continue this pattern regardless of how large
Save TestVerticalBars.bs2 as TestVerticalBarsYourTurn.bs2.
Modify the
Run the program and verify that the bar graph now displays 31 different levels,
from 1 to 31.
DO
...
[line + cursor, custChar]
FOR value = 1 TO 31
ELSE
SEROUT 14, 84, [Line0 + cursor, " ",
IF value <= 16 THEN
will result in 0 if
code block can be added that positions the cursor on either Line 0 or
that
DO
...
LOOP
value
sets
in the Main Routine as shown below.
Line1 + cursor, " "]
the
variable falls between. The actual display range is from
value
The custChar variable selects one of the
>>
bit
Chapter 7: LCD Bar Graphs for Distance and Tilt · Page 285
is 16, in 1 if
(value
FOR
pattern
...
' Print custom character
NEXT
in
&
The line variable can
value
loop
%1111)
the
StartValue
is 17, and so on up to 15 if
rowMap
.
value
SEROUT
The
becomes. Since
and
variable
command has
calculation
EndValue
was

Related parts for 28029