rcx workshop day 2 programming with touch sensor light sensor repeat cj chung associate professor of...
TRANSCRIPT
RCX Workshop Day 2
Programming with • Touch Sensor • Light Sensor
Repeat
CJ ChungAssociate Professor of Computer ScienceLawrence Technological University
Start-Touch
Wait until the touch sensor is pressed; Then start the robot to go forward Stop after a second
Start-Touch
Start-Bright
Wait until the light sensor detects very bright light
Then start the robot to go forward Stop after a second
Start-Bright
Stop-Touch
Go straight until the bumper is hit then stop
Stop-Touch
Go Till Edge
Go straight until the white edge of the ring
Then stop
Go Till Edge
Loop
To repeat a sequence of code blocks
Until Number of repetitions Forever
Elapsed time Sensor condition is met Logic becomes true
To play A note three times
Make the robot move around in the ring – Basic Sumo (Sumo0)
Repeat the following forever: Go forward until the edge Backward slightly Turn right
Make the robot move around in the ring – Basic Sumo (Sumo0)
Repeat the following forever: Go forward until the edge Backward slightly (in Big block) Turn right
First Sumo Competition
Additional Mission, if time available
Unknown start – Let the robot wait 5 seconds when the game starts
Additional Mission, if time available
Touch the wall Go back slightly Turn (spin) right Stop at the target;
Wall
Start