INTERMEDIATE PROGRAMMING LESSON By: Droids Robotics Debugging Techniques.

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
By Lego Works NXT Light Sensors on the EV3 ADVANCED EV3 PROGRAMMING LESSON © 2015 EV3Lessons.com, Last edit 1/29/
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.
Using the Gyro Sensor and Dealing with Drift
BEGINNER PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
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.
INTERMEDIATE PROGRAMMING LESSON By: Droids Robotics My Blocks Overview Step-by-Step Visual Guide to Creating a My Block with Inputs with Outputs.
ADVANCED EV3 PROGRAMMING LESSON
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
Alternative Squaring on a Line
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.
INTERMEDIATE PROGRAMMING Lesson
ADVANCED EV3 PROGRAMMING LESSON By Droids Robotics 1 Data Logging (Part 2)
Data Logging (Part 1).
By Droids Robotics INTERMEDIATE PROGRAMMIN G LESSON MOVE DISTANCE MY BLOCK (MOVE_CM)
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.
Bonus EV3 Programming Lessons By Droids Robotics LEGO MINDSTORMS and Raspberry Pi Communicator.
Bonus EV3 Programming Lessons By Droids Robotics PixyCam for MINDSTORMS Color Identifinder.
ADVANCED EV3 PROGRAMMING LESSON By Droids Robotics PROPORTIONAL ULTRASONIC WALL FOLLOWER © 2015, EV3Lessons.com, Last edit 11/17/2015.
Bonus EV3 Programming Lessons By Droids Robotics LEGO MINDSTORMS and Raspberry Pi IR Light controller.
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.
ADVANCED EV3 PROGRAMMING LESSON By Seshan Brothers Random Block.
ADVANCED EV3 PROGRAMMING LESSON By Droids Robotics © 2015, EV3Lessons.com (last edit 4/9/2015) Stall Detection with code from Hoosier Girlz.
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING Lesson
INTERMEDIATE programming LESSON: debugging Techniques: DISPLAY, LIGHT, Sound, Button Press… By Droids Robotics © 2014, Droids Robotics, v. 1.0,
INTERMEDIATE PROGRAMMING Lesson
By Sanjay and Arvind Seshan
INTERMEDIATE PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
INTERMEDIATE PROGRAMMING LESSON
By Sanjay and Arvind Seshan
Repeating Actions (Loops)
Line Followers: Basic to Proportional
BEGINNER PROGRAMMING LESSON
Line Followers: Basic to Proportional
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
By Sanjay and Arvind Seshan
Menu System.
BEGINNER EV3 PROGRAMMING Lesson
Presentation transcript:

INTERMEDIATE PROGRAMMING LESSON By: Droids Robotics Debugging Techniques

LESSON OBJECTIVES 1)Learn the importance of debugging 2)Learn some techniques for debugging your code © 2015, EV3Lessons.com, (last edit 4/5/2015) 2

Debugging is a useful strategy to figure out where in your program something is going wrong or what went wrong Once your code starts to become long or complicated (e.g. using sensors), it can become hard to figure out where in the program you are The following slides show you some ways of knowing where you are in your program or knowing what values your sensors see You will see that these techniques can be VERY USEFUL to any programmer. Locate Error Think of Solution Re-Test Program Fix Error HURRAY! WHY DEBUG? © 2015, EV3Lessons.com, (last edit 4/5/2015) 3

DIFFERENT TECHNIQUES Play Selected vs. Button Press Very similar techniques Lets you try out smaller portions of code Play Selected requires bluetooth Button Press requires some care so you don’t jostle the robot when pressing the button © 2015, EV3Lessons.com, (last edit 4/5/2015) Light, Sound and Display Very similar techniques Light and Sound are used in the same way Teams enjoy the sound more and it is easier to identify sometimes Display Block comes in handy for knowing what block is played if your robot gets stuck and if you want to see the sensor values 4

5 © 2015, EV3Lessons.com, (last edit 4/5/2015) Play selected is useful for running small parts of the program Use when you don’t want to wait for your robot to complete other parts of the program before getting to the part you want to see If you don’t have bluetooth built in the computer, we recommend that you purchase a bluetooth dongle (US $10-15) because it makes this type of debugging easier To use, highlight the parts of the program you want to run and pick the play button with the parentheses (>) PLAY SELECTED

6 To place a Wait for Button Press block in your program, place a wait block into your program Go under brick buttons > compare > brick buttons, then choose which button needs to be pressed to continue the program Place these wait for button presses every block or two close to where the robot is not working correctly This can help you pinpoint which block is causing the robot to fail The robot will stop and “wait for you to press the button” “WAIT FOR” BUTTON PRESS © 2015, EV3Lessons.com, (last edit 4/5/2015)

7 VISUAL ALERTS: BRICK STATUS LIGHT BLOCK Brick status light blocks can be used for warnings Brick Status Light block Place these blocks at critical steps in your program You will then be able to visualize what block is playing and figure out where the error might be

8 © 2015, EV3Lessons.com, (last edit 4/5/2015) SOUND ALERTS: SOUND BLOCK You can insert different sounds at intervals (about every 5 blocks or so, and then run the program again while listening for beeps. Once you pick Play Tone, select Play Type and pick “play once” These sounds can help you narrow down where in the program something is going wrong. Sound block

9 © 2015, EV3Lessons.com, (last edit 4/5/2015) PRINT TO SCREEN: DISPLAY BLOCK Showing which block is playing on your robot Helps identify what block the robot is stuck on Seeing the sensor readings – to see what the robot sees! Move inches Light-1 100

10 © 2015, EV3Lessons.com, (last edit 4/5/2015) SAMPLE VIDEO ON NEXT SLIDE The video on the next slide is NOT intended as a solution to the Search Engine mission and isn’t even very good code to get there Instead, what you should look at is how debugging techniques were used during the run Wait for button press Sounds alerts Brick lights Sensor readings displayed on brick

11 © 2015, EV3Lessons.com, (last edit 4/5/2015) SAMPLE VIDEO – CLICK TO PLAY

12 © 2015, EV3Lessons.com, (last edit 4/5/2015) OTHER METHODS Recordings: You can record your runs with a camera. Then watch each run and observe what went wrong Comments: You can also use “comments” to help debug – we add comments to remember what older values were entered into a block. We watch the run and then adjust these values

13 © 2015, EV3Lessons.com, (last edit 4/5/2015) DISCUSSION GUIDE What are some good ways of debugging your code? Ans. Any of the techniques mentioned in this lesson

CREDITS This tutorial was created by Sanjay Seshan and Arvind Seshan from Droids Robotics. More lessons are available at Author’s © 2015, EV3Lessons.com, (last edit 4/5/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 14