70016 Parallax Inc, 70016 Datasheet - Page 104

TEXT INFRARED REMOTE FOR BOE-BOT

70016

Manufacturer Part Number
70016
Description
TEXT INFRARED REMOTE FOR BOE-BOT
Manufacturer
Parallax Inc
Datasheet

Specifications of 70016

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Boe-Bot®
For Use With
29122 - KIT PARTS IR REMOTE FOR BOE-BOT
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
70016SE
Manufacturer:
ST
0
One non-spaghetti code way to implement the LAST/PREV CH button is by moving the
code block that sends pulses to the servos into a subroutine.
command can be used instead of a
code because the
follows the subroutine call.
Add this
Servo_Pulses:
Save KeypadDirectionDistanceYourTurn.bs2 as
KeypadDirectionDistanceYourTurn2.bs2.
Move the
that delivers the servo pulses from the main routine into a subroutine. It should
look like this when you are done.
' -----[ Subroutine - Servo_Pulses ]----------------------------------
' Call this subroutine to deliver pulses to the servos.
' You must store the number of pulses in the value variable
' and the maneuver in the direction variable.
' ChDn = backward, VolUp = rotate right, VolDn = rotate left.
Servo_Pulses:
DEBUG "The value is: ", DEC value, CR
DEBUG "Running...", CR, CR
Spaghetti Code Alert!
Using the
many instructors, computer programmers, robot design managers, and others. The reason
it is called "spaghetti code" is because of the difficulties you can encounter when trying to
find a mistake in a program with too many
program works becomes like trying to visually follow a single noodle through a plate of
spaghetti.
DEBUG "Running...", CR, CR
Servo_Pulses:
RETURN
Servo_Pulses:
GOTO
command to jump to a label elsewhere in a program is frowned upon by
command sends the program to the command that immediately
label between the two
GOTO
label, the
command.
DEBUG
GOTO
GOSUB
command, and the
commands. Understanding how the
DEBUG
' <--- Add this label.
tends not to cause spaghetti
ChUp = forward,
shown here:
That way, a
FOR…NEXT
GOSUB
loop

Related parts for 70016