![]() |
"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?
|
Re: "GetUltrasonic" hangup
Quote:
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. |
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. |
Re: "GetUltrasonic" hangup
Quote:
Is the sensor returning valid values after the timeout? |
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). |
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