28176 Parallax Inc, 28176 Datasheet - Page 37

KIT PARTS PROCESS CONTROL W/TEXT

28176

Manufacturer Part Number
28176
Description
KIT PARTS PROCESS CONTROL W/TEXT
Manufacturer
Parallax Inc
Datasheet

Specifications of 28176

Accessory Type
Process Control
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
BASIC Stamp® 2 and Board of Education
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Challenge 1-4 Solution
Challenge 1-5 Solution
' -----[ Title ]-----------------------------------------------------------
' Process Control - ConditionalLoopingChallenge.bs2
' Sounds tone using conditional loops
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Declarations ]----------------------------------------------------
Photo
LED
Buzzer
PB
PBVal
PhotoVal
FreqVal
CountVal
DurVal
X
1.
2.
3.
Under the Subroutines section, add the subroutine for the predefined process:
To the main flowchart’s loop, add another predefined
process:
Make a flowchart for the predefined process (names
should match):
To the programs Main Routine
subroutine call for your predefined process:
GOSUB Indicator
Indicator:
RETURN
PIN
PIN
PIN
PIN
VAR
VAR
VAR
VAR
VAR
VAR
HIGH LED
PAUSE 250
LOW LED
0
5
10
13
Bit
Word
Word
Byte
Word
Byte
' Alias for photo resistor circuit on P0
' Alias for LED on P5
' Alias for buzzer on P10
' Alias for pushbutton on P13
' Bit variable to hold pushbutton value
' Variabe to hold RC Time value
' Frequency to sound
' Number of tones to sound
' Duration to sound tone
' General Counting variable
Chapter 1: Process Control and Flowcharts · Page 27
DO...LOOP
add a

Related parts for 28176