Download presentation
Presentation is loading. Please wait.
Published byAugusta Wilkinson Modified over 9 years ago
1
Robot Programming
2
Programming Behaviors Behaviors describe the actions and decisions of your robot
3
Basic Behaviors Individual, bite-size functions that your robot performs directly Basic Behavior Turn motor A on forwards
4
Simple Behaviors Built of several basic behaviors Let you describe a full action of the robot Simple Behavior Go forward until you hit a wall and then turn Turn motor A on forwards Get touch sensor reading from Port 1 Turn off motors A & C Turn motor A on backwards Turn motor C on forwards Compare sensor reading to constant 0
5
Complex Behaviors Describe the full scope of what the robot can do Always composed of smaller behaviors, so you can break them down Complex Behavior Navigate a maze Drive forward Turn right Stop when you hit a wall Drive forward Stop when you hit a wall Turn right Turn left
6
Flowcharts Visually organizes steps in different shaped bubbles Good way to work out steps before you translate them into code Start End Drive forward Have you hit a wall? Stop motors Yes No
7
Flowcharts What does this flowchart describe? Is the gum hard yet? What about this one? Chew gum Throw gum in trash Yes No Put gum in mouth Start End Stop Motors Touch sensor pushed? Start motors Yes No Start End Chewing gum Go when touch sensor is pushed
8
Pseudocode Halfway in between English and computer code Describe what sensors and motors do and see with simple behaviors
9
Pseudocode What behavior does this pseudocode describe? Back up when you hit a wall and turn right 1.Move forward until the touch sensor is pressed 2.Stop all motors 3.Reverse for 1 second 4.Stop all motors 5.Turn right
10
Review Basic behaviors are actions the robot performs directly Simple behaviors are actions like we think about them Complex behaviors describe more interesting functions of the robot Flowcharts organize the steps Pseudocode describes the steps using the robot’s motors and sensors
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.