I'm trying to add 2 analog sensors to my APM2.5 system, both are 5v potentiometers.
This is the essential code that I have added to the system:
static int read_alpha(void)
alpha = analogRead(7); //initially on 6, switch to 7
I am calling this at 10Hz inside the medium loop, although would prefer to read it at 50 Hz. Unfortunately it looks as if I am not reading data properly, something is going on with the hardware or software that I do not fully understand. Attached are plots showing the logged data at 10 Hz with weird drops back to a static value.