122-32000 Parallax Inc, 122-32000 Datasheet - Page 163

MANUAL PROPELLER

122-32000

Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-32000

Accessory Type
Manual
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
The type of exit that
the trapping call; it may have just happened to be the destination of a
Therefore, the code must be written in a way to detect which type was used.
possibilities are: 1) code may be designed such that a high-level method is the only place that
traps an abort and other mid-level code processes things normally without allowing
to propagate higher, or 2) aborting methods may return a special value that can not occur in
any normal circumstance, or 3) a global flag can be set by the aborting method prior to
aborting.
Example Use Of Abort
The following is an example of a simple-minded robot application in which the robot is
designed to move away from an object it senses with its four sensors (
Back
CON
PUB Main | Direction
PUB Move(Direction)
PUB DriveMotors(Direction)
#0, None, Left, Right, Front, Back 'Direction Enumerations
Direction := None
repeat
result := TRUE
if Direction == None
repeat 1000
<code to drive motors>
if MotorStuck
). Assume that
case CheckSensors
if not \Move(Direction)
return
DriveMotors(Direction)
abort FALSE
Left : Direction := Right
Right : Direction := Left
Front : Direction := Back
Back : Direction := Front
other : Direction := None
Beep
CheckSensors
MayAbort
actually used,
,
Beep
, and
4: Spin Language Reference –
MotorStuck
ABORT
'Get active sensor
'Object on left? Let's go right
'Object on right? Let's go left
'Object in front? Let's go back
'Object in back? Let's go front
'Otherwise, stay still
'Move robot
'We're stuck? Beep
'Assume success
'Return if no direction
'Drive motor 1000 times
'If motor is stuck, abort
or
RETURN
are methods defined elsewhere.
, is not automatically known by
Propeller Manual v1.0 · Page 163
Left
RETURN
,
Right
,
command.
Front
RETURN
Some
and
s

Related parts for 122-32000