rcx workshop day 2 programming with touch sensor light sensor repeat cj chung associate professor of...

Post on 27-Mar-2015

218 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

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

top related