Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Ultrasonics (http://www.chiefdelphi.com/forums/showthread.php?t=47248)

Ctx32 06-05-2006 21:06

Ultrasonics
 
I have wrote the code for this over and over, This way and that way.
But I can't get 2 sonics to work at anytime.
I need 4 sonics to cover the 4 sides of my bot.(east-west-north-south)
Can someone help me solve this problem?
Calvin

Kingofl337 06-06-2006 10:56

Re: Ultrasonics
 
The way you want to run the ultrasonics is

void OperatorControl ( void )
{
while ( 1 )
{
StartUltrasonic ( 1 , 9 ) ; // Sensor1
Ultra1 = GetUltrasonic ( 1 , 9 ) ; // Sensor 1
StopUltrasonic ( 1 , 9 ) ; // Sensor 1
StartUltrasonic ( 2 , 10 ) ; // Sensor 2
Ultra2 = GetUltrasonic ( 2 , 10 ) ; // Sensor 2
StopUltrasonic ( 2 , 10 ) ; // Sensor 2
}
}


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