lego mindstorm an introduction to blocks. blocks blocks are used to give instructions to your robot....

15
Lego MindStorm An Introduction to Blocks

Upload: poppy-dennis

Post on 05-Jan-2016

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Lego MindStorm

An Introduction to Blocks

Page 2: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Blocks

• Blocks are used to give instructions to your robot.

• There are many types of blocks• You can use the blocks that come with the NXT

software. • You can create your own blocks.

Page 3: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Common Blocks

• The common blocks:

Page 4: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Common Blocks

• Move

– Tells your robot to move. • Record Play

– The record play block allows your robot to record itself (movements and sound) and replay its actions later in the program.

Page 5: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Common Blocks cont.

• Sound

– Allows your robot to play a sound file.• Display

– Displays an image on the NXT brick screen.

Page 6: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Flow Blocks

• The Flow Blocks

Page 7: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Flow Blocks

• The Loop Block– Use the loop block if you want your robot to

continue doing the same things again and again, such as moving forward and backward until a touch sensor is pressed.

Page 8: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Flow Blocks

• The Switch Block– The switch block enables the robot to make its

own decisions, such as going left when it hears a loud sound and turning right when it hears a soft sound.

Page 9: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Flow Blocks

• The Wait Blocks– The wait block makes your robot wait for sensor

input, such as a sound or a time interval.

Distance Light Sound Time Touch

Page 10: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Action Blocks

• The Action Blocks

Page 11: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Action Blocks

• Display– The display block enables you to control the

display on the NXT brick. You can type, show icons or even draw through your program!

Page 12: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Action Blocks

• Lamp– The lamp block tells your robot when to turn the

lamp on/off. You can program your robot to turn on its lights when the touch sensor is triggered, or when it becomes dark.

Page 13: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Action Blocks

• Message Send – The message send block tells your robot to send

information to another robot or to your computer.

Page 14: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Action Blocks

• Motor– The motor block tells your robot to turn on a

motor. – This is different from the move block.– Your robot may have multiple motors attached.

Page 15: Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks

Other Blocks

• There are other blocks that do more specific actions, such as:– Sensor Blocks• Used for controlling sensors (Ex: distance sensor, sound

sensor)

– Data Blocks• Logic

– Advanced Blocks