Go to Post I'm not worried about the amount of Segways at a regoinal, I'd rather see them out in the real world than at a robotics competition. - Joe Matt [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 12-02-2011, 18:52
thepcphysician thepcphysician is offline
Registered User
FRC #1678
 
Join Date: Jan 2010
Location: Davis, CA
Posts: 12
thepcphysician is an unknown quantity at this point
Potentiometer causes code to hang

Hello everyone,

We are having a problem with our potentiometer code. We essentially are continuously polling the potentiometer, using "GetAverageValue". This works, but it causes severe problems; the robot will suddenly "hang" and remain unresponsive to user input for 5-10 seconds. This will occur several times each minute, but in between hang periods, the code will operate perfectly.

We initially tried using "GetValue" instead, as we suspected the problem was caused by excessive averaging overloading the C-RIO. However, this did not resolve the problem; the ONLY way we were able to improve the problem was by putting a wait in the loop, polling the potentiometer every .1 seconds. This introduces more lag than we'd like, but it does reduce the hang problem significantly, although it does not eradicate it completely.

Any ideas you might have are much appreciated - we're stumped.
__________________
Perhaps today is a good day to die!
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 13:55.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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