What is the difference between ESP32 Dev kit & Uno for analogread() Function?
As Uno -0 to 1023 As Esp 32 Dev Kit -0 to 4095
So what will be the raw val & scale val ?
For UNO -
int Rawval = analogRead(analogPin);
Serial.print("Rawvalue from Analog input =");
Serial.print(Rawval);
Scaleval = map(Rawval, 0, 675, 0, 20);
Serial.print(" Scaled Value =");
What will be for ESP32 Dev Kit?
Ref UNO- // For 3V3 input to read 100%, 3V3 of 5V ref = (3.3 / 5) * 1023 = 675
/// === RELAY code ===
// raw value 675 correspond to 20%, so for 5% we will get 169
if ( Rawval < 169) digitalWrite(RELAY_pin, HIGH);
else digitalWrite(RELAY_pin, LOW);
}
What will be for ESP32 Dev Kit?
For UNO -int Rawval
and I don't want to break things as much as fix them.analogread()
at all, but about something else ... please update your question and ask about the real focus of your questionraw val
andscale val
?