122-28029 Parallax Inc, 122-28029 Datasheet - Page 294

GUIDE STUDENT SMART SENSORS

122-28029

Manufacturer Part Number
122-28029
Description
GUIDE STUDENT SMART SENSORS
Manufacturer
Parallax Inc
Datasheet

Specifications of 122-28029

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Smart Sensors
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Page 282 · Smart Sensors and Applications
The command
1 bits in %1111111100000000 right by the
is called a bit mask, and it makes it possible to use values from 16 to 31 to give you the
same results as 0 to 15. If
>> (value & %1111)
rowMap
%11100000. Compare that to the custom character for 3 in Figure 7-3. If
low byte result of the
Figure 7-3. Try it for each value (0 to 15) and you'll see the pattern that the bits in the
rowMap
Defining a custom character involves sending eight bytes. The binary values in each
successive byte define each of the eight rows in the character, from top to bottom. The
FOR
uses the
define a row of 5 black or white pixels in the custom character. Let's say that value is 3,
so
IF
IF
pixels white. By the sixth time through the
the
the sixth, seventh, and eighth rows down will be black, which results in the character
shown in Figure 7-3.
...
...
rowMap
...
IF
THEN
THEN
NEXT
...
byte match the pattern of the rows with black pixels in Figure 7-3.
THEN
is a only byte variable, it only stores the lowest eight bits of the term, which is
.LOWBIT
statement sends a byte containing %00000 to the LCD, which makes all the
statement examines
FOR index = 0 TO 7
NEXT
RETURN
SEROUT 14, 84, [%11111]
bits are the ones the LCD uses to define its five-pixel-wide rows.
is %11100000. The first time through the
loop in the
IF rowMap.LOWBIT(index) = 1 THEN
ELSE
ENDIF
statement sends a
rowMap = %1111111100000000 >> (value & %1111)
SEROUT LcdPin, T9600, [%11111]
SEROUT LcdPin, T9600, [%00000]
operator to check each bit in the
rowMap
Def_Vert_Bar_Char
stores %0001111111100000 in the
value
variable is %11110000. Now, take a look at character 4 in
rowMap.LOWBIT(0
SEROUT
is 3, the command
actually sends the byte %00011111, and the lower five
command with a byte containing %11111. So,
value
FOR
subroutine has an
...
NEXT
variable. The term
), the rightmost bit. Since it's 0, the
rowMap
FOR
rowMap = %1111111100000000
loop,
...
NEXT
variable and use it to either
rowMap.LOWBIT(5)
rowMap
IF
loop,
...
THEN
(value & %1111)
index
variable. Since
code block that
shifts the eight
value
is 0, so the
is 4, the
= 1, so

Related parts for 122-28029