NXT Basics *

46
NXT Basics: Technic Building and NXT-G Erin Cejka Riecker Center for Engineering Educational Outreach Tufts University

description

LEGO

Transcript of NXT Basics *

Page 1: NXT Basics *

NXT Basics: Technic Building and NXT-G

Erin Cejka RieckerCenter for Engineering Educational OutreachTufts University

Page 2: NXT Basics *

Getting to Know the NXT

Page 3: NXT Basics *

Motors and Sensors

Page 4: NXT Basics *

Hardware Comparison

Page 5: NXT Basics *

Technic or “Studless” Building

Pieces: Studless beams Connectors Axles

Features: Symmetry Sturdy

Page 6: NXT Basics *

Build a Two Motor Car

Page 7: NXT Basics *

Software Options

ROBOLAB 2.9

LEGO Mindstorms for NXT(NXT-G)

Page 8: NXT Basics *

Using ROBOLAB 2.9 with the NXT New sensors

Screen control

Page 9: NXT Basics *

Using ROBOLAB 2.9 with the NXT

NXT control panel appears during download

Page 10: NXT Basics *

NXT-G Interface

Toolbar

Workspace

Configuration Panel

Help & Navigation

ControllerPalettes

Tutorials

Web Portal

Sequence Beam

Page 11: NXT Basics *

NXT-G tools

Pointer tool: move blocks, select blocks Pan tool: move within workspace Comment tool: add notes to your code

Page 12: NXT Basics *

Intro to NXT-G: Palettes

Common: Complete:Custom:

Most All blocks Downloadedcommonly and createdused blocks blocks

Page 13: NXT Basics *

Writing a Basic Program Drag and drop block(s) on sequence

beam

Manipulate Configuration Panel & Download

Page 14: NXT Basics *

Intro to NXT-G: Controller

Download & Run Selection

Download & Run

NXT Window

Download Stop

Page 15: NXT Basics *

ROBOLAB vs. NXT-G

Page 16: NXT Basics *

ROBOLAB vs. NXT-G

In ROBOLAB In NXT-G

Icons or VIs Blocks

Modifiers Configuration Panel

Wiring together icons Sequence beams

Need start & stop light

Start is given, no stop needed

Page 17: NXT Basics *

NXT Rotation Sensor

Built in to motors Measure degrees

or rotations Reads + and - Degrees:

accuracy +/- 1 1 rotation =

360 degrees

Page 18: NXT Basics *

Viewing Sensors

Connect sensor Turn on NXT Choose “View” Select sensor type Select port

Page 19: NXT Basics *

NXT Sound Sensor Sound sensor can measure in dB and dBA

dB: in detecting standard [unadjusted] decibels, all sounds are measured with equal sensitivity. Thus, these sounds may include some that are too high or too low for the human ear to hear.

dBA: in detecting adjusted decibels, the sensitivity of the sensor is adapted to the sensitivity of the human ear. In other words, these are the sounds that your ears are able to hear.

Sound Sensor readings on the NXT are displayed in percent [%]. The lower the percent the quieter the sound.

http://mindstorms.lego.com/Overview/Sound_Sensor.aspx

Page 20: NXT Basics *

Challenge: Stop with sound

Program your NXT car to drive until you yell “Stop”

Page 21: NXT Basics *

Example Program: Stop with Sound

Page 22: NXT Basics *

NXT Ultrasonic/Distance Sensor Measures

distance/proximity

Range: 0-255 cm Precision: +/- 3cm Can report in

centimeters or inches

http://mindstorms.lego.com/Overview/Ultrasonic_Sensor.aspx

Page 23: NXT Basics *

Challenge: Parking NXT

Program your NXT car to drive forward until you “find a parking spot” (hit a touch sensor)

The car should then turn into the spot, and stop when it gets close enough to wall.

Page 24: NXT Basics *

Example Program: Parking NXT

Page 25: NXT Basics *

A note about NXT memory Memory space is limited! To clear space, use NXT window Show and delete system files for more

space

Page 26: NXT Basics *

NXT Structure: Loops

Page 27: NXT Basics *

Challenge: Stay on Table

Program your NXT to stay on the table

Page 28: NXT Basics *

Example Program: Stay on Table

Page 29: NXT Basics *

NXT Structure: Switch

Page 30: NXT Basics *

Challenge: Remote Control

Program car to drive while the touch sensor is pushed and stop while the touch sensor is released

Page 31: NXT Basics *

Example Program: Remote Control

Page 32: NXT Basics *

NXT Sound NXT can play sound files or notes Sounds take up more memory space

Page 33: NXT Basics *

NXT Display Display images, text, or drawings Choose location on display screen 100 x 64 pixels (up to 7 lines of text) Graphics take up memory space

Page 34: NXT Basics *

Challenge: Say Hello

Have the RCX say hello using sound and the display screen

Don’t forget – the program ends after the last block. You may need a wait for to see the display.

Caution: one of the options in the configuration panel is Clear – use it to clear screen. Otherwise, uncheck the box!

Page 35: NXT Basics *

Example Program: Say Hello

Page 36: NXT Basics *

My Blocks

Create custom blocks Saved in custom palette Download blocks from the web

Page 37: NXT Basics *

Creating My Blocks

Write the code for the My Block

Page 38: NXT Basics *

Creating My Blocks

Select all the blocks to be used for My Block

Page 39: NXT Basics *

Creating My Blocks Choose “Create My Block” on toolbar Or, go to the Edit menu and select

“Make a new My Block”

Page 40: NXT Basics *

Creating My Blocks Name My

Block

Add a description

Page 41: NXT Basics *

Creating My Blocks Create a

custom icon

Page 42: NXT Basics *

Creating My Blocks

My Block appears in Custom Palette

Page 43: NXT Basics *

Challenge: Create My Block

Come up with a program where you might use a My Block

May use it to repeat actions or to conserve workspace

Page 44: NXT Basics *

Example Program: Create My Block This program displays “If you’re happy

and you know it, press the touch sensor (and hold it)!”

If the touch sensor if pressed, it displays a happy face, otherwise it displays a sad face

A My Block is used for the text display

Page 45: NXT Basics *

Example Program: Create My Block

Page 46: NXT Basics *

Design Challenge: Alarm System Build an alarm system using the NXT Alarm can be triggered by any sensor

(or use more than one) Alarm should have an audio component Alarm can use display or motors as well