Waits, Loops and Switches Worksheet Answer Key

Waits, Loops and Switches Worksheet Answer Key

<p>Name: ______Date: ______Class: ______</p><p>Waits, Loops and Switches Worksheet Answer Key</p><p>1. Program the robot to perform the following (first, attach to your robot 2 touch sensors, name them A and B, and a sound sensor):  Stay at rest and display “Ready” on the screen until detecting a loud noise. Once a loud noise is detected:  Move left and display “Left” whenever touch sensor A is pressed.  Move right and display “Right” whenever touch sensor B is pressed.  Move forward and display “Forward” whenever both touch sensors A and B are pressed.  Stay at rest and display “Stop” when no buttons are pressed.</p><p> Hint: Click on the icon, drag the block into the program, and select “Text” from the drop-down menu to display text on screen.</p><p>2. Brainstorm about possible programming solutions and write below the one that your group thinks is the best one. Write in English the various steps that are necessary. 1. Display “Ready” on the screen</p><p>2. Wait until the sound sensor perceives a noise</p><p>3. If touch sensor in port 1 is pressed</p><p> a. If touch sensor in port 2 is pressed</p><p> a.i. Display “Forward” and move forward</p><p> b. Else if touch sensor in port 2 is not pressed</p><p> b.i. Display “Left” and turn left</p><p>4. Else if touch sensor 1 in port 1 is not pressed</p><p> a. If touch sensor in port 2 is pressed</p><p> a.i. Display “Right” and move right</p><p> b. Else if touch sensor in port 2 is not pressed</p><p> b.i. Display “Stop” and don’t move</p><p>5. Repeat Steps 2-4 forever</p><p>Using Wait, Loops and Switches Activity—Worksheet Answer Key 1 Name: ______Date: ______Class: ______</p><p>3.</p><p>Draw the various NXT blocks that will be needed in the program.</p><p>Using Wait, Loops and Switches Activity—Worksheet Answer Key 2 Name: ______Date: ______Class: ______</p><p> Then use the LEGO software to create your program, download and test it with the robot and sensors, revise and retest as necessary until it works as a successful solution.</p><p>4. Did you have to “iterate” (make changes to the program, etc.) to make it work? How many iterations did you have to perform? Explain. Answers will vary. Example answer: No, we did not have to iterate; our program worked the first time through.</p><p>Using Wait, Loops and Switches Activity—Worksheet Answer Key 3</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    3 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us