28123 Parallax Inc, 28123 Datasheet - Page 255

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
Example Program: SelectCaseWithValues.bs2
' What's a Microcontroller - SelectCaseWithValues.bs2
' Enter a value and see the minimum variable size required to hold it.
'{$STAMP BS2}
'{$PBASIC 2.5}
value
DEBUG "Enter a value from", CR,
DO
DEBUGIN DEC value
SELECT value
CASE 0, 1
CASE 2 TO 15
"0 to 65535: "
DEBUG "Bit", CR
PAUSE 100
DEBUG "Nib (Nibble)", CR
Enter and run SelectCaseWithValues.bs2.
Click the Debug Terminal’s Transmit Windowpane.
Enter a value between 0 and 65535, and press the Enter key.
What happens if you enter a number larger than 65535? If you enter the number 65536,
the BASIC Stamp will store the number 0. If you enter the number 65537, the BASIC Stamp
will store the number 1, and so on. When a number is too large for the variable it fits into, it
is called overflow.
Use Table 2-2 to verify that the example program makes the right decisions
about the size of the numbers you enter into the Debug Terminal.
VAR
Table 2-2: Variable Types and Values They Can Store
Variable type
Word
Word
Byte
Nib
Bit
Range of Values
0 to 1
0 to 15
0 to 255
0 to 65535

Related parts for 28123