Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   "GetUltrasonic" hangup (http://www.chiefdelphi.com/forums/showthread.php?t=45772)

P1h3r1e3d13 23-03-2006 19:52

"GetUltrasonic" hangup
 
Has anyone tried using the VEX Ultrasonic sensor with EasyC for FRC? The GetUltrasonic command seems to be taking 1/4 - 1/2 second to execute (which causes big problems). Does it take that long for everyone else?

BradAMiller 24-03-2006 07:49

Re: "GetUltrasonic" hangup
 
Quote:

Originally Posted by P1h3r1e3d13
Has anyone tried using the VEX Ultrasonic sensor with EasyC for FRC? The GetUltrasonic command seems to be taking 1/4 - 1/2 second to execute (which causes big problems). Does it take that long for everyone else?

Question: is this the first time trying the sensor or has it been working and recently stopped working?

The ultrasonic sensor code will loop while it's getting no result from the sensor, then time out after 2 seconds. If you're seeing that, try checking the connections or the sensor - that the input port on the sensor is connected to the digital output port on the RC and the output port on the sensor is connected to the interrupt port on the RC (digital I/O port 1-6).

A bad connection will result in no returns from the sensor and the timeout will occur.

P1h3r1e3d13 24-03-2006 17:40

Re: "GetUltrasonic" hangup
 
I've checked the connections, and I've used the sensor before, but not in any capacity where I would've noticed the response time.

It is possible that it didn't have anything in range of of which to reflect. Would that cause the timeout?
I'll check whether response time improves when I put something close to the sensor.

BradAMiller 25-03-2006 07:00

Re: "GetUltrasonic" hangup
 
Quote:

Originally Posted by P1h3r1e3d13
I've checked the connections, and I've used the sensor before, but not in any capacity where I would've noticed the response time.

It is possible that it didn't have anything in range of of which to reflect. Would that cause the timeout?
I'll check whether response time improves when I put something close to the sensor.

If there is nothing in range, then the hardware in the rangefinder returns a maximum value - which wouldn't cause the timeout.

Is the sensor returning valid values after the timeout?

P1h3r1e3d13 12-04-2006 00:44

Re: "GetUltrasonic" hangup
 
Yeah, that's what I thought (about out of range).
And no, it never returns a valid value, so far as I can tell. The user byte display on the OI should be showing the US distance, but all I ever see is 000 or occasionally 012 (for just one loop).

lynca 27-04-2006 11:16

Re: "GetUltrasonic" hangup
 
I have also noticed a considerable hang time when reading the sonar sensor. From testing mulitiple sonars, the problem is usually hardware related such as a loose cable or connector. Always listen for a faint clicking noise to make sure the sonar is operating.

However, the sonar driver needs updating on the easy C kit, possibly something more interrupt based similar to kevin watson's accelerometer code.


All times are GMT -5. The time now is 03:18.

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