Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Resetting a potentiometer (http://www.chiefdelphi.com/forums/showthread.php?t=103090)

hsekhon27 17-02-2012 16:07

Resetting a potentiometer
 
I have programmed a potentiometer to give me the heighest 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?

wireties 17-02-2012 16:26

Re: Resetting a potentiometer
 
Quote:

Originally Posted by hsekhon27 (Post 1128930)
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


All times are GMT -5. The time now is 00:49.

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