Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Potentiometer help (http://www.chiefdelphi.com/forums/showthread.php?t=43480)

Unholy 07-02-2006 16:51

Potentiometer help
 
Greetings everybody,
I'm Dan from 1402, and I have sort of an issue in my hands among with my programming group. To begin with, we're not very C-savvy, so just bear with us. We want to include a potentiometer in our program, but we're not exactly sure how to go about it. Last year, I was thrown into programming during the season, so I never really quite got the potentiometer part. We are not exactly sure where to add the basic potentiometer data (definition, etc). Also, we plan to have set values, so we are wondering where could we define such values. We appreciate any help we can get.
Thanks in advance,
-Dan, Yuriy, and Chris

kaszeta 07-02-2006 17:00

Re: Potentiometer help
 
Quote:

Originally Posted by Unholy
Greetings everybody,
I'm Dan from 1402, and I have sort of an issue in my hands among with my programming group. To begin with, we're not very C-savvy, so just bear with us. We want to include a potentiometer in our program, but we're not exactly sure how to go about it. Last year, I was thrown into programming during the season, so I never really quite got the potentiometer part. We are not exactly sure where to add the basic potentiometer data (definition, etc). Also, we plan to have set values, so we are wondering where could we define such values. We appreciate any help we can get.
Thanks in advance,
-Dan, Yuriy, and Chris

Pots are easy. Check out the FIRST Guidelines, Tips, and Good Practices document. But basically, the pot gives a 0-5 V signal, which is read by the RC using Get_Analog_Value() (unless you're using Kevin Watson's ADC.c/h), yielding a 10 bit value (0-1023).

Unholy 07-02-2006 17:34

Re: Potentiometer help
 
Quote:

Originally Posted by kaszeta
Pots are easy. Check out the FIRST Guidelines, Tips, and Good Practices document. But basically, the pot gives a 0-5 V signal, which is read by the RC using Get_Analog_Value() (unless you're using Kevin Watson's ADC.c/h), yielding a 10 bit value (0-1023).


So, would it be ok to put that command under UserRoutines.c, or where would you suggest to put that command?

kaszeta 07-02-2006 17:40

Re: Potentiometer help
 
Quote:

Originally Posted by Unholy
So, would it be ok to put that command under UserRoutines.c, or where would you suggest to put that command?

Wherever you're trying to use the value (user_routines.c is the most obvious place). What are you trying to do with the pot?

Unholy 07-02-2006 17:48

Re: Potentiometer help
 
Quote:

Originally Posted by kaszeta
Wherever you're trying to use the value (user_routines.c is the most obvious place). What are you trying to do with the pot?

We're trying to have set values to fire at a given angle. We're using the pot to give us reference. Also, we are planning to use it during autonomous mode. Personally, I am a bit confused since last year I had a robot.c/.h divison. By the way, thanks for the help ^_^


All times are GMT -5. The time now is 01:34.

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