View Full Version : Sonar programming
NeatTeam
06-02-2012, 14:47
We tried to activate the Sonar sensor with this code:
http://www.mediafire.com/?kay8tn380d00syh
But unfortunately it did not work ( as in getting the distance of the object which stands infront it)
can anyone examine the code and help us understand why?
Thank you.
Alan Anderson
06-02-2012, 21:21
I'm not going to download a random "rar" file from a suspicious site.
Have you tried one of the "EZ1 MB1010 Sonar" LabVIEW examples?
NeatTeam
07-02-2012, 09:58
I'm not going to download a random "rar" file from a suspicious site.
Have you tried one of the "EZ1 MB1010 Sonar" LabVIEW examples?
We tried both examples, analog and digital, and the indicator showed the value 0 in diffrent situations.
What may cause this problem?
We tried both examples, analog and digital, and the indicator showed the value 0 in diffrent situations.
What may cause this problem?
How did you wire up the sensor?
NeatTeam
07-02-2012, 10:52
How did you wire up the sensor?
First we wired it to Analog input and used the analog sonar example code from NI, and it showed 0.
Then we tried the digital sonar example code and we wired the Sonar to Digital I/O and it showed 0 again.
Alan Anderson
07-02-2012, 11:14
The example software is assumed to be good, so we can rule that out as a cause of your problem. That leaves configuration and wiring as the primary suspects. You did change the example's properties to connect to 10.19.43.2 instead of 10.0.0.2, right?
How exactly did you wire the sensor? Don't just say "to an analog" or "to a digital" -- give specific details on what pin or hole each wire comes from and goes to.
What is the battery voltage displayed on your Driver Station? What is the Robot Signal Light doing?
It could be that your sensor is faulty, but I've never seen one of those go bad.
NeatTeam
08-02-2012, 11:04
Ok so I've added the code in an attachment to this message and we've wired the sonar as the diagram showed in the example.
Thanks.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.