LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

NXT Motors with ultrasonic sensor. (Robot that doesn't run into walls)

Okay, the pattern of movement is as follows:

            

The robot moves for 5000 miliseconds than stops for 1000ms. this continues on forever (while loop)

 

 

 

I'm trying to add an "IF" factor. In other words, if the robot comes within 10 centimeters of something, it turns around. Therefore I need the ultrasonic sensor.

 

I'm pretty sure I need a case structure, but I seem to be having trouble. something is wrong with it and im not even really sure what it is. 

 

Can somebody give me an idea of how the case structure works, what goes in the true or false, any information at all?

 

fyi: im using labview 7.0 student edition, NXT mindstorm toolkit

 

0 Kudos
Message 1 of 3
(7,653 Views)

Hi kbgoro,

what have you done so far? You should read the ultrasonic senor value inside the while loop. If it reaches a specified value you should decide what to do. Use the case structur to do different things. If your robot is 10 centimeters or less away from something could be the true case and else the false case, so insert the specific code in the true or false case.

 

Mike

0 Kudos
Message 2 of 3
(7,649 Views)

This article is intended to carry out a program to monitor the status and speed of a motor connected to the NXT Intelligent Brick MindStorm from the front panel on the computer

 

https://decibel.ni.com/content/docs/DOC-32450

 

4.png

0 Kudos
Message 3 of 3
(6,090 Views)