RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of...
-
Upload
william-kent -
Category
Documents
-
view
217 -
download
0
Transcript of RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of...
![Page 1: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/1.jpg)
RCX Workshop Day 2
Programming with • Touch Sensor • Light Sensor
Repeat
CJ ChungAssociate Professor of Computer ScienceLawrence Technological University
![Page 2: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/2.jpg)
Start-Touch
Wait until the touch sensor is pressed; Then start the robot to go forward Stop after a second
![Page 3: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/3.jpg)
Start-Touch
![Page 4: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/4.jpg)
Start-Bright
Wait until the light sensor detects very bright light
Then start the robot to go forward Stop after a second
![Page 5: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/5.jpg)
Start-Bright
![Page 6: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/6.jpg)
Stop-Touch
Go straight until the bumper is hit then stop
![Page 7: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/7.jpg)
Stop-Touch
![Page 8: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/8.jpg)
Go Till Edge
Go straight until the white edge of the ring
Then stop
![Page 9: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/9.jpg)
Go Till Edge
![Page 10: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/10.jpg)
Loop
To repeat a sequence of code blocks
Until Number of repetitions Forever
Elapsed time Sensor condition is met Logic becomes true
![Page 11: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/11.jpg)
To play A note three times
![Page 12: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/12.jpg)
Make the robot move around in the ring – Basic Sumo (Sumo0)
Repeat the following forever: Go forward until the edge Backward slightly Turn right
![Page 13: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/13.jpg)
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
![Page 14: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/14.jpg)
First Sumo Competition
![Page 15: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/15.jpg)
Additional Mission, if time available
Unknown start – Let the robot wait 5 seconds when the game starts
![Page 16: RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.](https://reader035.fdocuments.in/reader035/viewer/2022062511/55148437550346d36e8b4b4f/html5/thumbnails/16.jpg)
Additional Mission, if time available
Touch the wall Go back slightly Turn (spin) right Stop at the target;
Wall
Start