voltage measurement code?

how to write the code in arduino one if i need to do some measurements of voltage A0, A1,12, A3, at the same time and these measurements take you to the serial plotter,
thanks for your help and understanding?
if you can help me pls do not hesitate.


The Arduino has only one analog to digital converter, so you have to make one measurement after another.

After switching channels, it is usually a good idea to make a measurement, ignore it, and make another to use.

For example:

int x1,x2;
x1 = analogRead(A1);
x2 = analogRead(A2); //discard this value
x2 = analogRead(A2);

can I help someone write the code in arduino one for some maths only read analog voltage, but the same ones in the serial plot I write the code only for a measurement but how to write if more than measure A0, A1, A2 , A3, void setup () {
Serial.begin (9600);}
void loop ()
int sensorValue = analogRead (A0);
float voltage = sensorValue * (5.0 / 1023.0);
Serial.println (voltage);

@afrim, please do not cross-post. Threads merged.

I don’t know how you plot more than one voltage. You might have to write a program on the computer for that. But, if you want to display it as text you can do that.

This code is untested:

 void setup() {


   int ADCreading;
   float Voltage;

void loop() {

  ADCreading = analogRead(A0);
  Voltage =ADCreading * (5.0 / 1023.0);
  Serial.print("A0 = ");                      

  ADCreading = analogRead(A1);     // Extra read for ADC settling time.
  ADCreading = analogRead(A1);
  Voltage =ADCreading * (5.0 / 1023.0);
  Serial.print("A1 = ");


(You may not need the extra read since it takes some time to print between reads.)

…If you want, you can “simplify” some of your code by combining functions & expressions and eliminating the “temporary” variables. But it makes it harder to read/understand -

Again, this is untested and I left out the setup()

  Serial.print("A1 = ");
  Serial.println(analogRead(A1) * (5.0 / 1023.0));