View Single Post
  #2   Spotlight this post!  
Unread 17-02-2012, 16:26
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Resetting a potentiometer

Quote:
Originally Posted by hsekhon27 View Post
I have programmed a potentiometer to give me the highest number of degrees it turned. But I want to reset it to a default value using a limit switch. any ideas on how to do that?
You can't physically reset the pot in software but you can use the limit switch to learn a "home" position and thereafter subtract home from the current reading to derive an absolute position.

If the pot will rollover (from max R to 0 and back) things get a little tricker. You'l have to maintain your own "index", index = how many times pot has rolled over and increment/decrement the index as the pots rolls forward or backwards though its zero point.

HTH
__________________
Fast, cheap or working - pick any two!