28123 Parallax Inc, 28123 Datasheet - Page 218
28123
Manufacturer Part Number
28123
Description
TEXT WHAT'S A MICROCONTROLLER
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet
1.28123.pdf
(340 pages)
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
- Current page: 218 of 340
- Download datasheet (6Mb)
You can also call one subroutine from within another. This is called nesting subroutines.
Light Meter Using Subroutines
The segments on the display cycle in a circular pattern that gets faster when the light on
the photoresistor gets brighter.
displayed by the 7-segment LED display goes slower.
The program that runs the light meter will deal with three different operations:
Each operation is contained within its own subroutine, and the main
cycle and call each one in sequence, over and over again.
Example Program: LightMeter.bs2
1. Read the photoresistor.
2. Calculate how long to wait before updating the 7-segment LED display.
3. Update the 7-segment LED display.
√
√
√
√
Make any necessary adjustments to the
looks right with all three subroutines.
Try moving the
subroutines, and see how it works.
Enter and run LightMeter.bs2.
Verify that the circular pattern displayed by the 7-segment LED display is
controlled by the lighting conditions the photoresistor is sensing. Do this by
casting a shadow over it with your hand or a piece of paper.
When nesting subroutines the rule is no more than four deep. See the BASIC Stamp
Manual for more details. Look up
Controlled lighting conditions make a big difference. For best results, conduct this test in
a room lit by fluorescent lights with no direct sunlight (close the blinds). For information on
how to calibrate this meter to other lighting conditions, see the Your Turn section.
GOSUB
When the light gets dimmer, the circular pattern
that calls
GOSUB
and
Subroutine_Name
RETURN
DEBUG
.
commands so that the display
into one of the other
DO…LOOP
routine will
Related parts for 28123
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
COMPETITION RING FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
TEXT INFRARED REMOTE FOR BOE-BOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
CONTROLLER 16SERVO MOTOR CONTROL
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BASIC STAMP LOGIC ANALYZER
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: