28123 Parallax Inc, 28123 Datasheet - Page 294

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
Figure 10-5
Adding the Photoresistor Circuit
ACTIVITY #3: SUBSYSTEM INTEGRATION EXAMPLE
Now that all the elements in the sensor array are built and tested, you can now write a
program that makes use of all four sensor circuits. This example will demonstrate how to
program the BASIC Stamp to display a terminal with a menu that a technician might use
to monitor the sensors.
Programming a Menu System and Using the Input/Output PIN Directive
The
In the next example program, the
named
program executes a
program executes a
You can use the
PBASIC program. The BASIC Stamp Editor will then figure out whether you are using
the I/O pin as an input or an output (or both). The
P9
ON…GOSUB
request
ON offset , GOSUB Target1, {Target2, Target3,…}
ON request GOSUB Read_Pushbutton_1, Read_Pushbutton_2,
PinName PIN PinNumber
220
command can be very useful for menus.
to direct it to one of four subroutines. If the value of
PIN
GOSUB Read_Pushbutton_2
GOSUB Read_Pushbutton_1
directive to give a name to each I/O pin you are going to use in a
Vss
Read_Pot, Read_Photoresistor
ON...GOSUB
0.1 µF
, and so on.
command uses the value of a variable
PIN
. If the Value of
directive’s syntax is:
P15
P14
P13
P12
P11
P10
P9
P8
P7
P6
P5
P4
P3
P2
P1
P0
X2
X3
Vdd
Vin
request
request
Vss
is 1, the
is 0, the

Related parts for 28123