1 / 85

Basic NXT-G Programming

Basic NXT-G Programming. NXT-G. Sequence Beams Blocks Structures (special blocks) Wires (connect ports on blocks & structures). Forward 2, Back 2, Talk. 01-Basic Program.rbt. Save this program!. Forward 2, Back 2, Talk. Save this program!. Loop 36 times.

chika
Download Presentation

Basic NXT-G Programming

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. Basic NXT-G Programming

  2. NXT-G Sequence Beams Blocks Structures (special blocks) Wires (connect ports on blocks & structures)

  3. Forward 2, Back 2, Talk 01-Basic Program.rbt Save this program!

  4. Forward 2, Back 2, Talk Save this program!

  5. Loop 36 times 02 Simple Structure - Loop.rbt Save this program!

  6. Loop 36 times Save this program!

  7. Branch on a Variable & Use Wires What's a “Variable”? It's a box to put something in, like text, a number, or a true/false value. Why might we use a “Variable”? To reference it later in the program. What is a “Compare” block? A “Compare” block tests the value of a numeric variable against a another number. When might we use a “Compare” block? To test the value of a sensor...

  8. Branch on a Variable & Use Wires 03 Variables.rbt 03-Variables.rbt

  9. Branch on a Variable & Use Wires

  10. Branch on a Sensor & Use Wires 03.1-Sensor And Branch.rbt Extra Credit!

  11. Branch on a Sensor & Use Wires

  12. Design Principles & Strategies

  13. Design Principles & Strategies KISS Tool Design First – Then Program Leapfrog Development Competitive Development Test Repeatedly Change 1 Small Thing at a Time Test Repeatedly

  14. Design Principles & Strategies KISS Quick Attachment Switching Specialized Tools Test Repeatedly Stiff & Stable is Repeatable and Reliable Leverage Change 1 Small Thing At A Time Repetitive Testing Slow Motion Video

  15. Tactical Techniques Standard Starting Location Standard Starting Configuration Straight Lines using Move Blocks Pivot Turns (some folks call these Swing Turns)

  16. Basic Techniques

  17. Incremental Development with Bluetooth Where to go from here?

  18. Incremental Development with Bluetooth Now we will write a program together using Bluetooth incremental development Move Forward Lower Arm Trapping 3 Pylons and Blue Ring Backup to Base Raise Arm Back to Starting Position

  19. Incremental Development with Bluetooth Mission 1 - Basic

  20. Incremental Development with Bluetooth

  21. Precise TurnsLeft Face! Hold one wheel still Drive with the other wheel Make your drive in two parts, slow then fast You’re not done until you have strung it together with the moves before and after the turn

  22. Precise TurnsLeft Face! 04-Left Face.rbt

  23. Precise TurnsLeft Face!

  24. VideoWhat’s really going on here? Once we looked at a slow motion video of our robot we found out we hadn’t really been seeing what our robot was doing…

  25. VideoWhat’s really going on here? We're going to show you: Video at full speed Video in slow motion Video in frame by frame Watch: 1 House & Core Rig Slow Mo video.MP4

  26. SensorsWhen should I stop? Go Forward until you see dark Use a move and a wait block Then add a stop block Check your light levels

  27. SensorsWhen should I stop?

  28. SensorsWhen should I stop?

  29. SensorsWhen should I stop? Go Forward until you see dark Use a move and a wait block Then add a stop block Check your light levels The wait until sensor block is one way to stop on a line... Our way is better when you need both power and accuracy. Now we'll build an improved loop checking sensor every 6 degrees Then try changing the number of degrees

  30. SensorsWhen should I stop?

  31. SensorsWhen should I stop?

  32. Medium Techniques

  33. MyBlocksGood things come in small packages Take our “Go to Dark” loop program and make it a MyBlock Combine a move with our “Go to Dark” MyBlock

  34. MyBlocksGood things come in small packages

  35. MyBlocksGood things come in small packages

  36. MyBlocksGood things come in small packages

  37. MyBlocksGood things come in small packages

  38. MyBlocksGood things come in small packages

  39. Multi-Threaded Programmingwalking and chewing gum at the same time Advance on the blue ring while lowering the arm to just above the blue ring. Continue to move forward slowly while lowering the arm the rest of the way. Return to base.

  40. Multi-Threaded Programmingwalking and chewing gum at the same time

  41. Multi-Threaded Programmingwalking and chewing gum at the same time

  42. More Tactical Techniques Standard Starting Location Standard Starting Configuration Straight Lines using Move Blocks Pivot Turns 1-Count Loops to Synchronize Threads “Crowbars” to pry open loops and switches Use your own loops to check sensors and control movement for best accuracy CONTROL your own destiny by writing your own code

  43. Multi-Threaded Programmingwalking and chewing gum at the same time

  44. HappyBirthdayKate

  45. Advanced Techniques

  46. MyBlocks with Parameters“Siri, take me here!” Parameters make MyBlocks reusable in more situations MyBlocks become adaptable You only program 1 MyBlock that is applicable in different scenarios

  47. MyBlocks with Parameters“Siri, take me here!” Take our two part turn and add direction math Determine desired direction Add a variable for input Cut the wire and make a MyBlock!

  48. MyBlocks with Parameters

  49. Sensor CalibrationIs it night or just cloudy? First we'd like to explain the Calibrate Block Then we'll show you how we use it in our Calibrate program We've posted “Cougar Calibrate.rbc”, our calibrate program, on CougarRobot.com Why is Cougar Calibrate better?

  50. Sensor CalibrationIs it night or just cloudy?

More Related