I need to read 5 analog pins simultaneously , is it possible?
note that:
analogRead(1);
analogRead(2);
analogRead(3);
will not work this case
-
1on the UNO (mega should be same) the analogRead(x); takes about 500us to complete. So depending upon the reaction speed of the signals that may be sufficient. You need to ask yourself what is the precision of time you consider to be simultaneous. If you are only looking at sampling everything once a Kilo Hertz (give or take) then back to back reads may be sufficient.mpflaga– mpflaga2015年01月23日 21:11:25 +00:00Commented Jan 23, 2015 at 21:11
-
Why won't the code given work?tstew– tstew2015年01月24日 02:53:28 +00:00Commented Jan 24, 2015 at 2:53
1 Answer 1
No, it is not. The ADC in the MCU is only capable of sampling a single analog channel at a time.
If you require sampling more than one channel at a time then you will need to use one or more external ADCs that are capable of sampling multiple channels, or multiple ADCs each dedicated to a single channel.