LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MB1010 Ultrasonic Sensor Coding on Roborio

Hello!

My name is Dominic and I am on FRC Team 4779. We are looking for some help with programming an ultrasonic sensor into our code. The plan is to have an ultrasonic sensor measure the distance from the sensor to a wall. Once it is within the set distance (nine inches or less). I would like the code to activate a string of events to occur. We are lost being that we do not have a programming mentor anymore and are going off  forum posts and other information we can find online. 

Message 1 of 5
(4,882 Views)

Hello Dominic,

 

You might want to post or search chiefdelphi, as there will be a lot more FRC related content there.  The above linked thread seems to be using DAQmx, which is not really an option for you on a roboRIO, I don't think.  The sensor seems like it has a number of outputs (digital pulse-width, analog, serial) that you can choose from to read distance, mentioned under "Pin Out Description" on page 2.  If no one on the team is familiar with any of the sensor output options, you might want to try exploring analog first, because it is very direct.  You can even start testing with a volt meter if you want to make sure you are getting the right readings first.  You can find distance by dividing your voltage by the ratio stated in the specification sheet.

 

Good luck and have fun!

0 Kudos
Message 3 of 5
(4,752 Views)

Hey Dominic,

 

If you are using LabVIEW, there are MB1010 specific examples in the NI Example Finder. You can get to it from Help -> Find Examples..., once the example finder loads, go to FRC RObotics -> Sensors. You should see two MB1010 examples in the Sensors folder. On the front panel, there is a wiring diagram as well.

 

If you are not using LabVIEW, can you let us know what programming language your team uses? Also, what are you having trouble with? Are you having trouble with wiring? reading the values from the sensor? or programming the code that active a string of events?

 

Ren H.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 5
(4,741 Views)

Hey Dominic,

 

Just realized that you posted on the LabVIEW section of the forum. There is a FRC section, try posting it there in the future. 

Ren H.
Applications Engineering
National Instruments
0 Kudos
Message 5 of 5
(4,738 Views)