Download presentation
Presentation is loading. Please wait.
Published byLandon Bain Modified over 11 years ago
1
NXTG Workshop Day 2 Programming with Touch Sensor Light Sensor Ultrasonic Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University
2
Start-Touch Wait until the touch sensor is pressed; Then start the robot to go forward Stop after a second
3
Start-Light Locate the robot in the middle of the ring Wait until the light sensor detects very bright (lantern) light Then start the robot to go forward Stop after a second
4
Start-Light
5
Stop-Touch Go straight until the bumper is hit then stop
6
Stop-Edge Go straight until the white edge of the ring Then stop
7
Ultrasonic Sensor Test
8
Loop To repeat a sequence of code Until Elapsed time Number of repetitions Sensor condition is met Logic becomes true Forever
9
Say Yes – 10 times
10
Make the robot move around in the ring – Basic Sumo (Sumo0) Repeat the following forever: Go forward until the edge Backward slightly Spin right
11
Sumo0
12
First Sumo Competition Some matches Ask students to list ideas to improve the Sumo robot
13
Repeat Until Spin a little bit until it detects an object less than 10 inches If detected, stop spinning and say Object
14
Mission: Find a static object using the ultrasonic sensor & push it out of the ring, box Robot but the robot should remain on the ring!!
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.