View Full Version : How to program Sonar
Axaileyer
10-12-2014, 17:58
Hey there ChiefDelphi, first post. Our team is trying to make a simple code that will turn our robot when it has a value of less than 10 inches. Anybody know how to (or a link to) coding sonar? first year team btw
TylerStaudigel
11-12-2014, 08:16
What program are you using to code your robot?
Mark McLeod
11-12-2014, 10:14
This is the LabVIEW subforum.
It depends on what sensor you are using and which input-analog, I2C, SPI, etc.
In general, you will measure the value returned by the sensor for 10 inches, then use a case statement that:
Drives the motors forward while the value is greater than 10 inches
Reverses the motor on one side when the value is 10 inches or less
Skyehawk
07-01-2015, 10:05
http://imgur.com/A14Tgq0
This is always the code my team has used in order to get inches out of sonar, this is just off of memory.
If I remember correctly the sonar is wired for 12C
TylerStaudigel
07-01-2015, 10:12
Check out the examples under the help tab. They show you how to execute almost every function you could need on your robot ranging from drives to vision and sonar. All you need to do to use them is to drag and drop the vi after you open the example.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.