122-28176 Parallax Inc, 122-28176 Datasheet - Page 32
122-28176
Manufacturer Part Number
122-28176
Description
GUIDE STUDENT PROCESS CONTROL
Manufacturer
Parallax Inc
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
- Current page: 32 of 330
- Download datasheet (11Mb)
Example Program: ConditionalLooping.bs2
' -----[ Title ]-----------------------------------------------------------
' Process Control - ConditionalLooping.bs2
' Sounds tone using conditional loops
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Declarations ]----------------------------------------------------
Photo
LED
Buzzer
PB
PBVal
PhotoVal
FreqVal
CountVal
X
' -----[ Main Routine ]----------------------------------------------------
DO
LOOP
' -----[ Subroutines ]-----------------------------------------------------
WaitForButton:
RETURN
GetFreq:
RETURN
GOSUB WaitForButton
GOSUB GetFreq
GOSUB GetCount
GOSUB SoundTone
PAUSE 1000
DEBUG CLS, "Press the pushbutton to begin",CR
DO
LOOP WHILE (PB=1)
DO
LOOP UNTIL (FreqVal <= 4000)
√
√
√
√
DEBUG CR,"Enter the frequency to play (1 to 4000)",CR
DEBUGIN DEC FreqVal
Enter, save and run ConditionalLooping.bs2.
To begin, press the pushbutton as directed by the Debug Terminal.
Enter a frequency to play and the number of times to play it by typing a value
into the white text box at the top of the Debug Terminal, and then pressing
Return or Enter.
Test using valid and invalid values.
PIN
PIN
PIN
PIN
VAR
VAR
VAR
VAR
VAR
0
5
10
13
Bit
Word
Word
Byte
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
' Variable to hold RC Time value
' Frequency to sound
' Number of tones to sound
' General Counting variable
' loop until within range
Related parts for 122-28176
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
MANUAL FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
GUIDE STUDENT SMART SENSORS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
MANUAL PROPELLER
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
LEAD WIRES FLYING CABLE III/IV
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
BOARD ADAPTER AND FLY LEADS
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
PLATFORM CABLE USB II
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
KIT STARTER COOLRUNNER-II BUNDLE
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
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:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: