122-28176 Parallax Inc, 122-28176 Datasheet - Page 37

GUIDE STUDENT PROCESS CONTROL

122-28176

Manufacturer Part Number
122-28176
Description
GUIDE STUDENT PROCESS CONTROL
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-28176

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Propeller Education (PE) Kit
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 122-28176