Command to get analog input faster from 1 port

Hi everybody,

I m working on a project that requires to get analog input from the same port many times, as faster as possible.

The classic command analogRead() takes a huge amount of time.

I think it's du to the fact that the analog_to_bin converter need to be switched to the port we need to get input from.

But in the case that the same port is used several times, we can go faster by skiping some steps.

Do you have an idea?

Thx

Fazz

Look at wiring_analog.cpp, though I doubt mux switching is where the time is going - maybe you can interleave the conversion start and the read of the result with some useful work, instead of that polling loop in the middle of "analogRead".