28129 Parallax Inc, 28129 Datasheet - Page 19

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
Programming the Project
Program State_of_P7.bs2 shows how PBASIC can be used to instruct the BASIC Stamp
to do several tasks. First, the BASIC Stamp monitors the state of the pin P7, which is set
to function as an input. Remember, P7 is connected to the wiper terminal of the pot.
Depending on the analog voltage level at pin P7, the BASIC Stamp interprets the input as
low or high (binary 0 or 1). As soon as the input to P7 receives the high signal, the
BASIC Stamp sends a high signal to the LED circuit via pin P12. When the input is low,
a low signal is sent to P12. The Debug Terminal is also used to monitor the state of pin
P7.
Enter Program State_of_P7.bs2 into the BASIC Stamp Editor, and save it under a
convenient name, such as State_of_P7_1_1R0.bs2. This stands for Program Listing 1.1
Revision 0. Make sure the programming cable is properly connected to your Board of
Education and to the serial port on your computer. Also make sure that a battery or power
supply is properly connected, then run the program by pressing the Run
Ctrl-R.
P15
P14
P13
P12
P11
P10
P9
P8
P7
P6
P5
P4
P3
P2
P1
P0
X2
X3
IMPORTANT: Pay careful attention to placing the LM358 so that the index mark is to the
top, as shown on this breadboard example. If you place it in reverse, the op-amp will be
ruined after the battery or power supply is connected to the Board of Education.
Figure 1-8
Breadboard Example
Compare this breadboard example to the
schematic from Figure 1-7. Is the LM358
connected right? Does Vdd go to pin 8 and
does Vss go to pin 4?
It turns out that the answer to both questions is
yes. Vss is connected by a wire to the leftmost
terminal on the pot. Then another wire
connects from the leftmost pot terminal to pin 4
on the LM358.
Since you can follow a wire all the way from pin
4 on the LM358 to the Vss terminal, that means
it is in fact connected directly to Vss.
button, or

Related parts for 28129