Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   FIRST Tech Challenge (http://www.chiefdelphi.com/forums/forumdisplay.php?f=146)
-   -   Ultrasonics (http://www.chiefdelphi.com/forums/showthread.php?t=47233)

Ctx32 06-05-2006 08:42

Ultrasonics
 
I need help, I'm trying to setup 4 Ultras using EasyC.
But I'm new at this and can't get the program correct.
I get 1 working and try to add the next one, then nothing.
Can someone help me?
Calvin

Gdeaver 06-05-2006 08:59

Re: Ultrasonics
 
The easy c function has to be setting up a timer to time how long it takes from ping to reception of the ping. The function probably times out after 30 to 40 ms. Depending on how the initialize function is written, you may be able to in a loop initialize sonar one, read sonar 1, initialize sonar 2, read sonar 2, take action, loop goto sonar 1, ect.

Ctx32 06-05-2006 14:31

Re: Ultrasonics
 
Quote:

Originally Posted by Gdeaver
The easy c function has to be setting up a timer to time how long it takes from ping to reception of the ping. The function probably times out after 30 to 40 ms. Depending on how the initialize function is written, you may be able to in a loop initialize sonar one, read sonar 1, initialize sonar 2, read sonar 2, take action, loop goto sonar 1, ect.

I set the first sonar and it works great and haven't noticed a time out on it.
It prints to screen as long as I obstruct it.
But I try to initialize the 2nd sonar and both sonars go dead or the first one goes out and the second one prints to screen.
It's got to be my programming.
Can a pic be sent to this forum?
Calvin

Ctx32 06-05-2006 14:32

Re: Ultrasonics
 
Quote:

Originally Posted by Ctx32
I set the first sonar and it works great and haven't noticed a time out on it.
It prints to screen as long as I obstruct it.
But I try to initialize the 2nd sonar and both sonars go dead or the first one goes out and the second one prints to screen.
It's got to be my programming.
Can a pic be sent to this forum?
Calvin

Does anyone have an example I could look at?


All times are GMT -5. The time now is 17:59.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi