I am using Arduino Mega 2560 board.
I need two values that look right on interface.
I have a simple code down here but always the same problem.
Change potentiometer 1 then the two values will change.
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(A2, INPUT);
pinMode(A9,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int current1= analogRead(A2);
int current2=analogRead(A9);
int voltage1= current1 * (5./1023.);
int voltage2= current2 * (5./1023.) ;
Serial.print("Poti_1 ");
Serial.println(voltage1);
Serial.print("Poti_2 ");
Serial.println(voltage2);
delay (1000);
}