Lesson+3

Lesson 3 - Programming Your Robot

media type="custom" key="8849866"


 * The NXT Robot Traverses a Panel **


 * Objectives: **

When you complete this lesson, you should understand the following:

 How to compile a RobotC program and download it into the Lego NXT Mindstorm Robot.  How the motor and wait statements can be used to control movement of the Robot.  How to write and debug a program that will allow the NXT to traverse a rectangular panel.

== Procedures: ==

Please review the following videos before you begin the task:

 RobotC Rules (Part 1)  RobotC Rules (Part 2)  Programming Dissection  Timing  Half Motor Power  Turn and Reverse

<span style="font-family: 'Comic Sans MS',cursive; font-size: 16px;">Watch the following video (above) that demonstrates your task: program the NXT to complete one trip around the panel without touching the panel or the table rails. Please remember, this is your first NXT Project. So, it is very important to relax. The process of finding the correct software on your computer to use, writing your first program, compiling it (have the software turn human words into 0s and 1s the robot can understand), download the compiled code into the robot, and run it is a little scary. RELAX! Take your time and after a few repititions it will not seem like such a monumental task.

<span style="font-family: 'Comic Sans MS',cursive; font-size: 16px;"> The Key RobotC statements you will use to complete this task are shown in the following brief program: <span style="color: #002bff; font-family: 'Arial Black',Gadget,sans-serif; font-size: 16px; line-height: 23px;">task main  <span style="color: #002bff; font-family: 'Arial Black',Gadget,sans-serif; font-size: 16px; line-height: 23px;">{  <span style="color: #002bff; font-family: 'Arial Black',Gadget,sans-serif; font-size: 16px; line-height: 23px;">motor[motorB] = 50;  <span style="color: #002bff; font-family: 'Arial Black',Gadget,sans-serif; font-size: 16px; line-height: 23px;">motor[motorC] = 50;  <span style="color: #002bff; font-family: 'Arial Black',Gadget,sans-serif; font-size: 16px; line-height: 23px;">wait1Msec(2000);  <span style="color: #002bff; font-family: 'Arial Black',Gadget,sans-serif; font-size: 16px; line-height: 23px;">}

<span style="font-family: arial,helvetica,sans-serif; font-size: 13px; line-height: 19px;">**<span style="color: #0000ff; font-family: 'Comic Sans MS',cursive; font-size: 20px; letter-spacing: 0px;">Evaluation: **

<span style="font-family: 'Comic Sans MS',cursive; font-size: 16px; line-height: 24px;">You can evaluate your work using the following three-point rubric:

<span style="font-family: 'Comic Sans MS',cursive; font-size: 16px;">**Three points:** You were able to work successfully together and demonstrated proficient understanding of how the **motor** and**wait** statements can be used to move the robot in a desired manner. The task of moving the robot around the panel without touching the panel or table rails will be completed.

<span style="font-family: 'Comic Sans MS',cursive; font-size: 16px;"> **Two points:** Students were able to work together and discuss the problems that they encountered. They attempted some problem solving techniques and demonstrated some understanding of how the **moto**r and **wait** statements can be used to move the robot in a desired manner.

<span style="font-family: 'Comic Sans MS',cursive; font-size: 16px;"> **One point:** You worked poorly together and minimal understanding was demonstrated as to how the **motor** and **wait** <span style="font-family: 'Comic Sans MS',cursive; font-size: 16px;"> statements can be used to move the robot in a desired manner.

** Good Luck, Have FUN, and Don't let your Robot get Hurt! **