Session 06 nxc(1) - Session6 Debugging QUIZ1...

This preview shows page 1 - 2 out of 2 pages.

Session 6 Debugging & Repeating Blocks of Code QUIZ 1 Session Objective: At the end of this session you should be able to: Use problem-solving to debug a simple system Use repeat( ) to execute a block of code an given number of times Before You Come to Class (Homework) NXC Programmer’s Guide Read section II. Benedetteli’s PDF file NXC Programmer’s Guide (John Hansen) Read section 2.3.3 We will use this to understand the repeat( ) control structure. Activity 6.1  Mini Lecture: Debugging A Robot System Some of our groups had problems running Bumpbot-2 the first time. How do we discover what is wrong?  Debugging Your System Activity 6.2 Making a Square The following program is from Benedetteli’s PDF file  (section II).  #define MOVE_TIME 1000 #define TURN_TIME 325 task main() { repeat(4) { OnFwd(OUT_AC, 75); Wait(MOVE_TIME); OnRev(OUT_C, 75); Wait(TURN_TIME);} Off(OUT_AC); } Try different values for TURN_TIME in order to get the robot to make a perfect (well as close as you can 
Image of page 1

Subscribe to view the full document.

Image of page 2
  • Fall '09
  • PDF file, Turn, repeat

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern