122-28176 Parallax Inc, 122-28176 Datasheet - Page 23
![GUIDE STUDENT PROCESS CONTROL](/photos/8/99/89965/mfg_122-28176_sml.jpg)
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: 23 of 330
- Download datasheet (11Mb)
If you said the LED would blink on for ½ second when the button is pressed, and not at
all when not pressed, you would be correct.
Example Program: ConditionalLEDBlink.bs2
' -----[ Title ]-----------------------------------------------------------
' Process Control - ConditionalLEDBlink.bs2
' Blinks the LED based on state of Pushbutton
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Declarations ]----------------------------------------------------
Photo
LED
Buzzer
PB
PBVal
PhotoVal
BuzzerDur CON
' -----[ Main Routine ]----------------------------------------------------
DO
LOOP
Code Discussion
The
program will execute the code within the block if true or skip over it if false.
' ******** Read Pushbutton
PBVal = PB
' ******** Display Pushbutton value
DEBUG CLS,"Pushbutton value = ", DEC PBVal,CR
' ******** Button Pressed Conditional and Code
IF (PBVal = 0) THEN
ENDIF
' ******** 1/4 second pause
PAUSE 250
√
IF…THEN…ENDIF
Enter, save and run ConditionalLEDBlink.bs2.
HIGH LED
PAUSE 500
LOW LED
PIN
PIN
PIN
PIN
VAR
VAR
10
5
10
13
Bit
Word
250
block is used to test the condition. Based on the result, the
' 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
' Word variable to hold RC Time value
' Constant for duration of tone for buzzer
' Read Pushbutton Value and assign to PBVal
' If pushbutton pressed is true then,
' blink the LED
' Loop back to DO to repeat continuously
Chapter 1: Process Control and Flowcharts · Page 13
Related parts for 122-28176
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![122-27400](/photos/8/99/89964/mfg_122-27400_tmb.jpg)
Part Number:
Description:
MANUAL FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
![122-28029](/photos/8/99/89971/mfg_122-28029_tmb.jpg)
Part Number:
Description:
GUIDE STUDENT SMART SENSORS
Manufacturer:
Parallax Inc
Datasheet:
![122-32000](/photos/8/99/89977/mfg_122-32000_tmb.jpg)
Part Number:
Description:
MANUAL PROPELLER
Manufacturer:
Parallax Inc
Datasheet:
![HW-FLYLEADS](/photos/8/95/89575/hw-flyleads_tmb.jpg)
Part Number:
Description:
LEAD WIRES FLYING CABLE III/IV
Manufacturer:
Xilinx Inc
Datasheet:
![HW-USB-FLYLEADS-G](/photos/8/95/89577/hw-usb-flyleads-g_tmb.jpg)
Part Number:
Description:
BOARD ADAPTER AND FLY LEADS
Manufacturer:
Xilinx Inc
Datasheet:
![HW-USB-II-G](/photos/8/95/89581/hw-usb-ii-g_tmb.jpg)
Part Number:
Description:
PLATFORM CABLE USB II
Manufacturer:
Xilinx Inc
Datasheet:
![HW-CRII-PM-ACC-G](/photos/8/98/89837/hw-crii-pm-acc-g_tmb.jpg)
Part Number:
Description:
KIT STARTER COOLRUNNER-II BUNDLE
Manufacturer:
Xilinx Inc
Datasheet:
![30008](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
![30008](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
![70009](/photos/26/92/269208/70009-l_tmb.jpg)
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
![28135](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
![SX18AC/SO](/images/manufacturer_photos/0/5/515/parallax_inc_tmb.jpg)
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: