Nxt Lego Minds Storm Manual
Developed by Tony Ayad Updated by LeRoy Nelson California - Los Angeles Region FLL September 2012
Outline
• Purpose: • This workshop is intended for FIRST® LEGO® League (FLL®) coaches who are interested in learning about LEGO® MINDSTORMS® NXT and the NXT-G programming language. • Basic Programming Agenda (Introductory Workshop) • NXT Controller(aka: the “brick”) • Blocks • The NXT-G Interface • The MOVE, MOTOR & RESET Blocks • Turns - there is more than one way to turn • Geometry and Math for the Robot • Resources • Advanced Programming (for Advanced Workshop) • Light Sensors • Program Control (WAIT, LOOP, SWITCH Blocks) • Math (VARIABLES, MATH and COMPARE Blocks) • My Block • Touch Sensors
08/31/12
Basic Programming - Tony Ayad2
NXT Controller – The robot’s “brain” The USB port is used to connect to The PC so you can download the aka: the “Brick” Programs into NXT Controller
3 Output ports used for the motors
A
B
C USB
Name
Icons representing menu options Use this button to turn on the NXT and select the shown option SELECT menu option (right) Menu Level Back (off)
SELECT menu option (left)
4sensor Input ports used to attach sensors
1
2
3
4
08/31/12
Light Sensor
Basic Programming - Tony Ayad
Touch Sensor
3
FLL Robot Configuration
• For FLL Competition you are allowed: • 1 NXT Brick [or the discontinued RCX yellow Brick] • Up to 3 motors; two for moving; the third is for the arm • Any number of LEGO-manufactured MINDSTORMS type sensors: touch, light,color, rotation or ultrasonic [However, you only have 4 sensor ports on the NXT!] • You can use as many non-electric LEGO pieces as you need • You may NOT use ANYTHING that is not made by LEGO • Instructing the robot to move and turn is accomplished by the NXT Motors, which rotate in a predetermined direction. • All examples used in this document assume the robot configuration with motors mounted asshown.
Clockwise B - Motor C - Motor
08/31/12
Basic Programming - Tony Ayad
4
LEGO® MINDSTORMS ® Education NXT Software
• The FLL Robot Set includes the LEGO MINDSTORMS Education NXT Software • The current NXT-G software version is V.2.1.6 • This icon-based easy-to-use software is based on LabVIEW®
• LabVIEW is powerful system design software for engineering and science
• TheEducation version includes Robot Educator step-by-step guide
• 46 tutorials from beginner to advanced levels
• The Education version also includes data logging functionality
• Collect and analyze data from sensors
• Includes comprehensive digital user manual • Includes team license
08/31/12
Basic Programming - Tony Ayad
5
Programming the NXT Robot
• NXT software uses differentprogramming “BLOCKS”. Here are some of the most commonly used blocks.
Programming Block? It is a specific step or action the robot will perform.
08/31/12
Basic Programming - Tony Ayad
6
LEGO MINDSTORMS NXT Interface
Program name Programming Palette menu. Each option has a set of program blocks; move the mouse over it to see the available blocks
Your Program. You can add andconfigure “blocks” to instruct actions such as moving forward or turning Sequence beam is where the blocks are placed and it is in the order in which they will be run. Program BLOCK: a programming instruction for the robot
Brick controller used to download programs to the NXT brick
Palette selector
08/31/12
Basic Programming - Tony Ayad
7
LEGO MINDSTORMS NXT Interface
Pointer toolto select objects by clicking the mouse
Pan tool to move the display. You can also use the left or right arrows to move the display
Comment tool allows you to create new comment boxes. Use these to describe what the robot is doing on the field for each step of the program.
08/31/12
Basic Programming - Tony Ayad
8
Steps to add a Programming Block
1. Click and hold block with...
Regístrate para leer el documento completo.