28129 Parallax Inc, 28129 Datasheet - Page 34

TEXT BASIC ANALOG & DIGITAL

28129

Manufacturer Part Number
28129
Description
TEXT BASIC ANALOG & DIGITAL
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28129

Style
Book
Title
Basic Analog and Digital
Contents
Basic Analog and Digital Text
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
So how do you count from decimal-0 to decimal-3 using the binary pushbuttons? The
two-bit binary equivalent of decimal-0 is 00. When you don’t press either of the
pushbuttons, the decimal output is 0 in the Debug Terminal. When you press the right
button, you get 01, which has a decimal equivalent of 1. When you press the left button,
you get 10, which has a decimal equivalent of 2. When you press both pushbuttons, you
get 11, which has a decimal equivalent of 3.
About the Code
As with the program of the previous chapter, the first lines start with an apostrophe, so
they are comments and compiler directives, and the BASIC Stamp ignores them.
' Basic Analog and Digital - PL2_1R0.bs2
' Program Listing 2.1 Revision 0.
' {$STAMP BS2}
' {$PBASIC 2.5}
Figure 2-4
Debug Terminal
Output for Program
Listing 2.1

Related parts for 28129