Library | Building | Programming | Quick Guides Home | Quick Guides to Building | Quick Guides to Programming | LVLM | WeDo
LabVIEW NXT Module (LEGACY)

DocumentsDate added

Order by : Name | Date | Hits [ Ascendant ]
file icon Wait for Pushhot!Tooltip 07/23/2007 Hits: 3432


 

This code illustrates the Wait-for-Push command. When a touch sensor on Port 1 is pressed, Motor A will stop.

file icon Touch Sensor Switchhot!Tooltip 07/23/2007 Hits: 2127

 

This code uses two very important coding commands, Case Structures and Loops. The touch sensor Switch causes Motor A to go forward if the touch sensor is released and backward if it is pressed. The Loop causes the Switch to loop infinitely.

 

file icon Snakehot!Tooltip 07/23/2007 Hits: 5215

 

When run, this code will cause a car to "snake" forward in wide arcs. The length of the turns can be modified by changing either the time or motor power.

file icon Play the Scalehot!Tooltip 07/23/2007 Hits: 2075

 

The NXT can also be used to play music. By placing notes manually custom songs can be created.

file icon Lurch 2hot!Tooltip 07/23/2007 Hits: 1379

This program beeps, runs Lurch-1, then beeps again.

file icon Lurch 1hot!Tooltip 07/23/2007 Hits: 1491

This code uses a Loop to turn Motor A on-and-off three times. When downloaded to a single motor car, this program will accelerate the vehicle forward in three short bursts. The number of loops can be changed by modifying the Constant "2". Alternatively, if you want an infinite program, you can set the stop condition of the loop to a false constant.

file icon Line Follower: Wait for Darkhot!Tooltip 07/23/2007 Hits: 1778

 

This program runs Motor B until the light reading is less than 50. Once the light reading is less than 50, Motor B stops and Motor C runs for 0.25 seconds. This processed is infinitely looped.

file icon Line Follower Switchhot!Tooltip 07/23/2007 Hits: 1721

 

This program is works like the Line Follower: Wait for Dark program but it uses a Switch. The program runs a Switch--in a infinite Loop--that runs Motor B and makes sounds when reading light. The program stops Motor B then runs Motor C for 0.25 seconds when reading dark.

file icon Echo Locationhot!Tooltip 07/23/2007 Hits: 1428

In this code, sound frequencies are played corresponding to changing light values. Light sensor readings, which fall between 0-100, are placed in a variable and multiplied by the constant 8. The value of that variable, which now falls between 0-800, becomes the frequency in Hz of the sound played. The frequency is also displayed on the NXT.

file icon Drive to Black Linehot!Tooltip 07/23/2007 Hits: 1429

 


 

There are many ways to stop a car at a black line. Using a light sensor attached to Port 1, the program takes the initial light reading, drives forward (one motor car) and waits for a difference greater than or equal to 15. Once this difference is reached, the Case Structure stops the NXT and exits the program.
«StartPrev12NextEnd»
Page 1 of 2
Home | About Us | Contact Us
© 2013 Center for Engineering Educational Outreach, Tufts University
© 2013 The LEGO Group. All rights reserved.