Quote:
|
Originally Posted by Matt Krass
My co-programmer and I are having some trouble with the RC. We've tried both a potentiometer and a gyro connected to the first analog input. I tried to get the raw value using:
Code:
printf("Raw value: %d\n", Get_Analog_Value(rc_ana_in01));
but it just prints -1. Any suggestions ?
Using newest compiler/IDE, firmware's updated and we're using newest default code.
|
The compiler doesn't seem to handle this very well. I've taken to just using a temporary variable for the return value of a function, then pass the value of the temporary variable into printf. Try this:
unsigned int temp_analog_value;
temp_analog_value = Get_Analog_Value(rc_ana_in01);
printf("Raw value: %u\n", temp_analog_value);
-Kevin