|
Page 1 of 1
|
[ 8 posts ] |
|
Multiple Ultrasonics with RobotC
| Author |
Message |
|
ptan
Rookie
Joined: Thu Oct 09, 2008 8:11 pm Posts: 4
|
 Multiple Ultrasonics with RobotC
Is there any way to only enable one Sonar/Ultrasonic sensor at a time?
We need to use multiple Ultrasonic Sensors at different heights and want to minimize the interference between each of the sensors on a Cortex Vex controller.
Ideally, we would like a way to enable one sensor, wait for the reading, then disable the pings from that sensor, then enable a 2nd sensor.
Is there any way to do this?
Thanks.
Paul Tan. Coach of Polar Bear Robotics VRC Team 2027
|
| Mon Oct 18, 2010 10:23 pm |
|
 |
|
DiMastero
Expert
Joined: Wed Jun 30, 2010 7:15 am Posts: 179
|
 Re: Multiple Ultrasonics with RobotC
Ok, I'm not really sure about this, but I think the US sensors only give out/ receive signals when they're told to, and won't interfere with other ones when activated at different times. As they take one reading per 70 mSecs, it might be best to let them function with about 75 mSecs in between them, I suppose. To do that, I think you could just make one variable per sensor, make a (while) loop to let it repeat until that variable is filled (which is once), and make the variable become the reading from the US sensor at the end of the loop. Example: You could also do that with a for loop, if you want. Hope this helps, DiMastero
_________________leonoverweel.com
|
| Tue Oct 19, 2010 2:56 am |
|
 |
|
ptan
Rookie
Joined: Thu Oct 09, 2008 8:11 pm Posts: 4
|
 Re: Multiple Ultrasonics with RobotC
Thanks for the thoughts, DiMastero, but can someone confirm or deny the above? I was told (I think the posts are still on this forum for NXT/FTC) that at least for RobotC on the NXT this was not possible, and that the Ultrasonics would be on continuously. Can someone confirm that this is not the case for Vex/Cortex, and that we could use several Ultrasonics as DiMastero has suggested we could? Thanks.
|
| Tue Oct 19, 2010 4:34 am |
|
 |
|
jbflot
Site Admin
Joined: Tue May 15, 2007 9:02 am Posts: 383
|
 Re: Multiple Ultrasonics with RobotC
Multiple ultrasonic sensors (unless aimed directly at one another) should not interfere with each other. However, they do operate using sound waves which are subject to interference and can bounce off in various directions. There is a way to turn on and off sensors in ROBOTC. Below is a program that turns on sensor 1 for 5 seconds, then turns on sensor 2 for 5 seconds, over and over. Note that I have ultrasonic sensor 1 plugged into digital ports 1 and 2, and ultrasonic sensor 2 plugged into digital ports 3 and 4. Hope that helps!
|
| Tue Oct 19, 2010 9:43 am |
|
 |
|
Jon_T
Rookie
Joined: Fri Oct 09, 2009 9:21 am Posts: 28
|
 Re: Multiple Ultrasonics with RobotC
Jesse, Can you use more than 2 ultrasonic sensors on the Cortex? I believe RobotC is only set up for 2 on the Pic.
_________________ Jon Thompson Coach - Twisted Bots VRC 177
|
| Tue Oct 19, 2010 1:11 pm |
|
 |
|
jbflot
Site Admin
Joined: Tue May 15, 2007 9:02 am Posts: 383
|
 Re: Multiple Ultrasonics with RobotC
Currently you can still only use two ultrasonic sensors. That said, we're looking into what impact (if any) adding more will have on the system as a whole, so that may change in the future.
|
| Tue Oct 19, 2010 6:27 pm |
|
 |
|
ptan
Rookie
Joined: Thu Oct 09, 2008 8:11 pm Posts: 4
|
 Re: Multiple Ultrasonics with RobotC
Is that only two (2) ultrasonics sensors active at at time? I.e. can I have two ultrasonic sensors on ports 1/2, 3/4, and then have two more at 5/6, 7/8, and activate the first set, deactivate it, and then activate the second set? Do I have to wait any settling times between activations/deactivations? Thanks. Paul Tan.
|
| Tue Oct 19, 2010 8:26 pm |
|
 |
|
ivanseidel
Rookie
Joined: Tue Sep 07, 2010 10:56 am Posts: 43
|
 Re: Multiple Ultrasonics with RobotC
Hi, to test if they are on while in not in use, use your ear, and place it to the emitter, it's a very low noise, if in silence you can hear it, i already tried, but i wasn't doing that task... put it to check constantly and see if you can hear the sound, test it with no data being received in the program, and have a conclusion Ivan
_________________ My creations: techlego.blogspot.com
|
| Wed Oct 20, 2010 10:43 am |
|
|
|
Page 1 of 1
|
[ 8 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 4 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|