28123 Parallax Inc, 28123 Datasheet - Page 191

TEXT WHAT'S A MICROCONTROLLER

28123

Manufacturer Part Number
28123
Description
TEXT WHAT'S A MICROCONTROLLER
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28123

Style
Book
Title
What's a Microcontroller?
Contents
Whats a Microcontroller? Text
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
Lead Free Status / RoHS Status
Not applicable / Not applicable
Unless you tell it to make a different kind of comparison, the
to see if a value is equal to an entry in the list. You can also check to see if a value is
greater than, less than or equal to, etc. For example, to search for an entry that is less
than or equal to the value variable, use the
starts the list.
' What's a Microcontroller - SimpleLookdown.bs2
' Debug an index using a value and a lookup table.
' {$STAMP BS2}
' {$PBASIC 2.5}
value
index
value = 167
DEBUG ? value
LOOKDOWN value, [7, 85, 19, 167, 28], index
DEBUG ? index, CR
DEBUG "Change the value variable to a ", CR,
"different number in this list:", CR,
"7, 85, 19, 167, or 28.", CR, CR,
"Run the modified program and ", CR,
"check to see what number the ", CR,
value = 35
LOOKDOWN value, <= [ 7, 19, 28, 85, 167 ], index
Re-run the program after each change to the
value from the list gets placed in the
Modify SimpleLookdown.bs2 by substituting this
statement:
Experiment with different values and see if the index variable displays what
you would expect.
Trick question: What happens if your value is greater than 167? This little twist in the
LOOKDOWN
make any changes to the index.
VAR
VAR
command can cause problems because the
Byte
Nib
<=
index
operator just before the first bracket that
variable.
value
LOOKDOWN
LOOKDOWN
variable and note which
value
command checks
command doesn’t
and
LOOKDOWN

Related parts for 28123