Go to Post Let's Just say i am the one that gives Firefighters, paramedics, and law enforcement a job - Tytus Gerrish [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
  #2   Spotlight this post!  
Unread 12-02-2011, 20:26
PatrickS's Avatar
PatrickS PatrickS is offline
I get my code from /dev/null
FRC #1742 (Shockwave)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Oklahoma City
Posts: 21
PatrickS is an unknown quantity at this point
Re: Potentiometer causes code to hang

Quote:
Originally Posted by thepcphysician View Post
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.
If you could post the relevant code it would help immensely.
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:56.

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