NXTG Workshop Day 2 - PowerPoint PPT Presentation

About This Presentation
Title:

NXTG Workshop Day 2

Description:

Ultrasonic Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University Start-Touch Wait until the touch sensor is pressed; Then ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 15
Provided by: CJC96
Category:

less

Transcript and Presenter's Notes

Title: NXTG Workshop Day 2


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,
but the robot should remain on the ring!!
Write a Comment
User Comments (0)
About PowerShow.com