1 / 18

Robotics

Robotics. NXT-G: variables, file Rotation sensor Lab: Use buttons to hit specific ball. Homework: Postings. Start planning mapping the room. Variable. Store value under a name and then re-use NXT-G Need to set up variable: name and data type Logic (true or false) Number Text

krhonda
Download Presentation

Robotics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Robotics NXT-G: variables, file Rotation sensor Lab: Use buttons to hit specific ball. Homework: Postings. Start planning mapping the room

  2. Variable • Store value under a name and then re-use • NXT-G • Need to set up variable: name and data type • Logic (true or false) • Number • Text • Then can read or write • Use as input to data link • Use as input to calculation • Demonstrate

  3. Button test • Use variable to hold which NXT button was pressed. • Use Edit/Define Variables • Need to give name (give meaningful name) • Need to specify datatype (number, text, logic)

  4. Warnings • If the task is to determine left or right button, you can’t wait for one button. • Instead, loop checking first one then the other button. Set variable (or use data wires and an OR operation) to exit the loop. • Probably need to insert pause(s).

  5. How to check? • Use display screen • Text • Specify text • NEED TO INSERT PAUSE SO I CAN SEE IT!

  6. Lab assignment • Do basic ball hitting exercise • Hit only red ball and only blue ball. • Enhance hitting ball exercise • Use buttons to indicate which ball is to be hit • Use variable • NOTE: you probably can do this just with data wires, but do it with a variable • Why?

  7. File • Set of values • Can be re-used by program or uploaded to computer • NXT-G • Delete (might do this initially to make sure there isn’t old file by the same name) • Write (actually append to end) • Close (need to do this before reading) • Read • Demonstrate

  8. First part: records light readings

  9. Second part: write out file

  10. …and you can upload file: Other under Memory

  11. Rotation sensor • Connect to particular motor. • Reset to zero. • Can measure in rotations or degrees.

  12. Mapping • Now have tools to record how far robot has moved • Rotation sensor: how many degrees a particular motor has turned • Variables and files to store data • Need a plan/strategy to 'map room' • Determine position of walls • Note: you know how to move until bump or move until ultrasonic indicates under a set amount.

  13. Challenges • Robot to store (for later use) where it found walls (or something else) • Use rotation sensor to determine distance traveled (will need to calibrate in terms of power) • Create file • Upload file • LATER: Robot to send information to second robot using Bluetooth.

  14. Lab/Homework • Use ultrasound than light to hit the red ball. Change to hit the blue ball • Use display, pause, buttons to specify which ball to hit. • Start planning room mapping task. • Postings

More Related