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).
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?
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