View Full Version : ultra sonic Sensor
katsauga
26-01-2014, 15:04
I am having trouble finding sample code for a MaxBotics ultrasonic sensor. Can Someone submit a place to start, or a sample Labview code? :D
The maxbotics ultrasonic sensor can output analog data, so you can wire it to the analog module and read it in labview as an analog source. There are other ways to read the data but this is the simplest.
katsauga
26-01-2014, 15:17
Thank you for the help, I have coded it and will test it as soon as our teams electrician wires it. Thanks for all the help!
Lightfoot26
26-01-2014, 15:20
Here is a quick example I snagged from Team 358's website (http://team358.org/files/programming/ControlSystem2009-/LabVIEW/)! A great reference for when I was first starting out!
Alan Anderson
26-01-2014, 21:32
I am having trouble finding sample code for a MaxBotics ultrasonic sensor. Can Someone submit a place to start, or a sample Labview code? :D
If you're looking for example LabVIEW code, a good place to start is the LabVIEW Examples. On the Getting Started window, select the Support tab. Click the "Find FRC Examples..." link on the right and it will open the NI Example Finder with the FRC Robotics folder selected.
Under the Analog folder you will find "EZ1 MB1010 Sonar - Analog.lvproj", and Under the Digital folder you will find "EZ1 MB1010 Sonar - Digital.lvproj":
This example shows how to use the MaxBotix LV-MaxSonar-EZ1 Sonar Range Finder MB1010. It will display the distance from the sensor in inches.
The examples include pictures of the proper wiring for the sensor.
MrTechCenter
26-01-2014, 23:04
If you're looking for example LabVIEW code, a good place to start is the LabVIEW Examples. On the Getting Started window, select the Support tab. Click the "Find FRC Examples..." link on the right and it will open the NI Example Finder with the FRC Robotics folder selected.
Under the Analog folder you will find "EZ1 MB1010 Sonar - Analog.lvproj", and Under the Digital folder you will find "EZ1 MB1010 Sonar - Digital.lvproj":
This example shows how to use the MaxBotix LV-MaxSonar-EZ1 Sonar Range Finder MB1010. It will display the distance from the sensor in inches.
The examples include pictures of the proper wiring for the sensor.
We used the Digital example and got an accurate reading from the example vi but when we tried to duplicate it in our own code, we failed to get a reading.
Alan Anderson
27-01-2014, 02:25
We used the Digital example and got an accurate reading from the example vi but when we tried to duplicate it in our own code, we failed to get a reading.
You know the sensor and wiring are correct, because the example works. The problem must therefore be with how you integrated it into your code. Show us what you did and we'll take a look at it. We need to see where you opened the sensor in Begin.vi and wherever you're reading and displaying its value.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.