27403 Parallax Inc, 27403 Datasheet - Page 68

GUIDE APP ROBOTCS W/SUMOBOT V1.0

27403

Manufacturer Part Number
27403
Description
GUIDE APP ROBOTCS W/SUMOBOT V1.0
Manufacturer
Parallax Inc
Datasheet

Specifications of 27403

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
SumoBot®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
pbSense
' -----[ Initialization ]-----------------------------------------------------
DEBUG CLS, "Press/hold/release" , CR,
' -----[ Main Routine ]-------------------------------------------------------
DO
LOOP
Your Turn - Controlling the LED with the Pushbutton
After adding the
flash on/off while you hold down the pushbutton. All it takes in an
the
DEBUG BIN1 pbSense
PAUSE 100
DO...LOOP
Save a copy of the program as TestPushButtonYourTurn.bs2.
Add the
Replace the
DO
LOOP
Run the program and verify that you now have pushbutton control of the LED.
Save the modified program.
For fun, try modifying the program so that it plays a list of notes when you
press/release the button.
DEBUG BIN1 pbSense
IF pbSense = 1 THEN
ELSE
ENDIF
PAUSE 100
"pushbutton on", CR,
"breadboard...", CR
TOGGLE LedSpeaker
LOW LedSpeaker
in the main routine.
PIN
PIN
LedSpeaker PIN
DO...LOOP
directive
6
LedSpeaker PIN 5
in the Main Routine with this one:
directive to this program, you can make the LED
' PROMPT press/release pushbutton
' Pushbutton connected to P6
' DO...LOOP repeats indefinitely
' Display state of pbSense (IN6)
' Delay for slower PCs
.
' DO...LOOP repeats indefinitely
' Display state of pbSense (IN6)
' Flash LED if pbSense = 1
' Otherwise, keep pin low
' Delay for slower PCs
IF...THEN
added to

Related parts for 27403