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 [ Descendent ]
file icon 2 Button Remotehot!Tooltip 07/23/2007 Hits: 1136

    

The two-button remote control is a very versatile program for controlling Lego robots. It uses a series of touch sensor Switches to determine which behavior you want to trigger. Since the Switches are between a set of Loops, the program loops infinitely, and the behavior of the robot will change every time a different touch sensor is hit.

In this program, the two-button remote is setup to control a car with motors connected to Ports B and C. When only touch sensor 1 is pressed, Motor B spins forward and Motor C spins backward. This will turn the car left or right. When only touch sensor 2 is pressed, the motors are reversed and the car will spin the opposite direction. If both touch sensors are held, the motors go forward. When no touch sensors are held, the car does not move. Remember, each branch of the Switch can control something different. It does not only work for a car. The touch sensors can trigger music, events, even mail to other robots. The possibilities are endless.

 

file icon 2 Button Remote Bhot!Tooltip 07/23/2007 Hits: 1067

This is another version of the 2 button remote. The touch sensor on port one drives motor B, while the touch sensor on port two drives motor C.


file icon 3 Button Remotehot!Tooltip 07/23/2007 Hits: 1099

Like its smaller cousin, the three-button remote control is a great way to define unique behaviors for your robot. The advantage to the three-button control is that there are now 8 possible behavior combinations, compared to just 4 on the 2-button remote. In addition to forward, left and right motion on our two motor car, it is now possible to move in reverse, and even control a third motor. With so many combinations, it is possible that you don?t need them all. In that case just leave one case of the Case Structure empty.

file icon Controlling the Displayhot!Tooltip 07/23/2007 Hits: 1081

This program uses two touch sensors combined with two Switches--all in an infinite loop--to display a number on the screen. Port 1 adds 1 and Port 2 adds 100. The "adder" variable is set to zero at the beginning of this program.

file icon Drive for Timehot!Tooltip 07/23/2007 Hits: 1428

 

 

This code turns on Motor A for two seconds, and then turns it off. Similiar codes can be made by adding motors or changing times.

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

 


 

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.
file icon Echo Locationhot!Tooltip 07/23/2007 Hits: 1429

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 Line Follower Switchhot!Tooltip 07/23/2007 Hits: 1722

 

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 Line Follower: Wait for Darkhot!Tooltip 07/23/2007 Hits: 1780

 

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 Lurch 1hot!Tooltip 07/23/2007 Hits: 1494

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.

«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.