Quote:
Originally Posted by RyanN
I also tried the quick_adc, but I was having trouble, so I went back to this...
|
You just use a number from 1 to 16 to select the ADC channel. As an example:
liftpos = Get_Analog_Value(1); or liftpos = Quick_ADC(1);
Of course you'd probably want to #define these values in a header file and then the code would look like this:
// this goes at the top of the source file or in a header file like robot.h
#define ARM_ELBOW_POT 1 // analog input one
#define ARM_WRIST_POT 2 // analog input two
unsigned int elbow_pot;
unsigned int wrist_pot;
elbow_pot = quick_adc(ARM_ELBOW_POT);
wrist_pot = quick_adc(ARM_WRIST_POT);
Because it's simpler, I would use quick_adc() if you're only using potentiometers on your 'bot.
-Kevin