const int currentpin = 34;
float R1 = 1000.0;
float R2 = 2000.0;
void setup() {
Serial.begin(115200);
pinMode(currentpin, INPUT);
}
void loop() {
int adc = analogRead(currentpin);
float adc_voltage = adc * (3.3 / 4096.0);
float current_voltage = (adc_voltage * (R1+R2)/R2);
float current = (current_voltage - 2.5) / 0.100;
Serial.print("Current Value: ");
Serial.println(current_voltage);
delay(1000);
}