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

Post on 05-Jan-2016

218 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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 that come with the NXT

software. • You can create your own blocks.

Common Blocks

• The common 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.

Common Blocks cont.

• Sound

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

– Displays an image on the NXT brick screen.

Flow Blocks

• The Flow 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.

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.

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

Action Blocks

• The Action 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!

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.

Action Blocks

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

information to another robot or to your computer.

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.

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

top related