By Droids Robotics Good Coding Practices: Start with Pseudocode BEGINNER EV3 PROGRAMMING LESSON © 2015 EV3Lessons.com, Last edit 4/1/2015 1.

Slides:



Advertisements
Similar presentations
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Topics Covered: Turning.
Advertisements

Squaring or Aligning on a Line
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
Parallel Beams INTERMEDIATE EV3 PROGRAMMING LESSON By Droids Robotics
Parallel Beam Synchronization
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Topics Covered: Display Block.
By Droids Robotics Infrared Sensor Intermediate EV3 PROGRAMMING LESSON © 2015 EV3Lessons.com, Last edit 5/26/
Menu System ADVANCED EV3 PROGRAMMING LESSON By Droids Robotics
INTERMEDIATE PROGRAMMING LESSON By: Droids Robotics Turn Degrees My Block.
BEGINNER PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
Picking Up and Moving an Object
By Mesa Robles Robotworks and Droids Robotics
Intermediate Programming Lesson: Improving Robot Reliability in FLL
BEGINNER EV3 PROGRAMMING Lesson
INTERMEDIATE PROGRAMMING LESSON By: Droids Robotics Color Line Follower My Blocks with Inputs: Move Until Black © 2014, Droids Robotics, v. 2.0, Last edit.
Gyro Turns ADVANCED EV3 PROGRAMMING LESSON By Droids Robotics
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Topics Covered: Switches.
INTERMEDIATE PROGRAMMING LESSON By: Droids Robotics Move Distance My Block (Move_Inches)
Calibrating Color Sensors
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Topics Covered: EV3 Basics Introduction to the EV3 Brick and Software.
BEGINNER EV3 PROGRAMMING Lesson
By Droids Robotics Line Followers: Basic to Proportional ADVANCED EV3 PROGRAMMING LESSON © 2015 EV3Lessons.com, Last edit 4/5/
 By Droids Robotics Code Contributed by FLL 1920 Line Following with Two Color Sensors and Proportional Control ADVANCED EV3 PROGRAMMING LESSON © 2015.
BEGINNER EV3 PROGRAMMING Lesson
By Droids Robotics INTERMEDIATE EV3 PROGRAMMING LESSON SIMPLE & OPTIMIZED ULTRASONIC WALL FOLLOW.
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Using Sensor Data and Port View.
By Droids Robotics INTERMEDIATE PROGRAMMIN G LESSON DATA WIRES.
By Droids Robotics INTERMEDIATE PROGRAMMING LESSON BRICK BUTTONS AS SENSORS.
ADVANCED EV3 PROGRAMMING LESSON By Droids Robotics PROPORTIONAL ULTRASONIC WALL FOLLOWER © 2015, EV3Lessons.com, Last edit 11/17/2015.
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Topics Covered: Touch Sensor.
By Droids Robotics INTERMEDIATE PROGRAMMIN G LESSON COLOR LINE FOLLOWER MY BLOCK WITH INPUTS: MOVE FOR DISTANCE.
INTERMEDIATE PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
By Sanjay and Arvind Seshan
By Sanjay and Arvind Seshan
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER PROGRAMMING LESSON
BEGINNER PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
Beginner Programming Lesson
BEGINNER PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
Lesson 4: Aligning on Lines On The Mat
Beginner Programming Lesson
BEGINNER PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
Repeating Actions (Loops)
Beginner Programming Lesson
BEGINNER PROGRAMMING LESSONS
BEGINNER PROGRAMMING LESSON
BEGINNER PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER PROGRAMMING LESSONS
BEGINNER PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
Advanced Programming Lesson: Parallel Beams
BEGINNER EV3 PROGRAMMING Lesson
INTERMEDIATE PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
Presentation transcript:

By Droids Robotics Good Coding Practices: Start with Pseudocode BEGINNER EV3 PROGRAMMING LESSON © 2015 EV3Lessons.com, Last edit 4/1/2015 1

Lesson Objectives 1. Learn what pseudocode means 2. Learn why you use pseudocode 3. Learn to write pseudocode for a common task 4. Learn how to plan programs for First Lego League © 2015 EV3Lessons.com, Last edit 4/1/2015 2

What is Pseudocode?  Robots follow directions that people give them. They need detailed, step-by-step instructions to complete a task.  It is a set of detailed notes that the programmer can use to write the code when they are ready.  It is not written in any particular programming language. Pseudocode can be in part English and part code.  Pseudocode allows the programmer to communicate his/her plan with others  Pseudocode is detailed enough to create the actual code © 2015 EV3Lessons.com, Last edit 4/1/2015 3

Why is Pseudocode Important?  A great way to learn the importance of good pseudocode is to try writing instructions for something simple:  How to make a sandwich, how to decorate a cake, how to plant a seed, etc.  Students should write the instructions and then the teacher should follow them.  Then compare the results.  Some examples of student responses for a peanut butter and jelly sandwich:  Student 1 wrote: “Put the peanut butter on the bread”. So the teacher placed the entire jar on the slices of bread.  Student 2 wrote: “Take bread and spread the peanut butter on it”. So the teacher spread peanut butter on the entire loaf.  Student 3 wrote: “Take 2 slices of bread and spread peanut butter and jelly on them”. So the teacher spread peanut butter and jelly on both sides of both slices.  Communicating instructions well is important! © 2015 EV3Lessons.com, Last edit 4/1/2015 4

Sandwich Pseudocode Solution  Take exactly two pieces of bread.  Take one piece of bread that is not covered with peanut butter on any side and use a knife to spread peanut butter on one side  Take a second piece of bread that is not covered with jelly on any side and use a knife to spread jelly on one side  Place the jelly side of the second piece of bread against the peanut butter side of the first piece of bread.  Place the combined pieces of bread on plate © 2015 EV3Lessons.com, Last edit 4/1/2015 5

Writing Pseudocode for a Robot 1) Write down the goal of the program. What does the robot have to do? 2) Think about how the robot will achieve this goal. What are the specific steps? 3) Write down each step the robot will take. Start with Step 1 and continue on. 4) Make sure you write down if the robot has to repeat a task. 5) Does the robot keep doing this task forever or does it end? © 2015 EV3Lessons.com, Last edit 4/1/2015 6

Sample Pseudocode for a Challenge  Goal: Robot needs to go once around a square box. It starts at the line and faces north. It will end on the line facing north.  Step 1: Go forward 10 inches  Step 2: Turn left 90 degrees  Step 3: Repeat steps 1 and 2 three more times  You can write this pseudocode on a piece of paper or even in a comment block inside the EV3-G code.  Use the pseudocode to program the solution © 2015 EV3Lessons.com, Last edit 4/1/ N

Pseudocode in First Lego League  Step 1: Use a tool such as our Interactive Sketch Planner (available on the Resources page) to plan your runs.  The goal is to plan out where your robot will travel each time it leaves the base area.  Step 2: Use a tool such as our Mission Planning Worksheet (available on the Resources page) to write your pseudocode for the runs. © 2015 EV3Lessons.com, Last edit 4/1/2015 8

Sample for First Lego League © 2015 EV3Lessons.com, Last edit 4/1/ Move forward (X inches) Turn Right (X degrees) Move Forward until Right Color Sensor sees red line Turn Left (X degrees) Follow Red Line until Black T-junction Lower attachment arm to grab hoop Move backwards X inches (until inside base) Search Engine: Pull the correct hoop NW Corner Motorized grabber X. Sample Both these tools are available in the Resources Tab of ev3lessons.com

Credits  This tutorial was created by Sanjay Seshan and Arvind Seshan from Droids Robotics.  Author’s  More lessons and resources are available at © 2015 EV3Lessons.com, Last edit 4/1/2015 This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License.Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License 10