28123 Parallax Inc, 28123 Datasheet - Page 298

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
' -----[ Subroutine - Read_Photoresistor ]---------------------------------
Read_Photoresistor:
Your Turn – Modifying Subroutines
Terminals are not the only application for
the four different subroutines one after another, here is a way to do it:
Notice that the two subroutines that do the terminal work were commented and the
ON…GOSUB
ACTIVITY #4: DEVELOPING AND ADDING A SOFTWARE SUBSYSTEM
Let’s say that your sensor array is getting placed in a device that only certain employees
are allowed to use, and they have to supply a password. This means you will have to
expand your program so that it saves and verifies a password. It’s better to write a
password program that functions on its own first, and then add it to your larger program.
RETURN
HIGH PhotoPin
PAUSE DelayRc
RCTIME PhotoPin, 1, time
DEBUG CLS, ? time, "
PAUSE DelayReader
RETURN
DO
LOOP
Save
TerminalOperatedSensorArrayYourTurn.bs2.
Modify the main routine by making the changes just discussed.
Run the program and verify that it cycles through the measurements.
command was placed in a
' GOSUB Display_Menu
' GOSUB Get_Request
FOR request = 0 TO 3
NEXT
ON request GOSUB Read_Pushbutton_1, Read_Pushbutton_2,
your
example
"
Read_Pot, Read_Photoresistor
FOR…NEXT
program
ON…GOSUB
loop.
. For example, if you want to call
under
the
new
name:

Related parts for 28123