Voltage Monitoring Using ESP32 and 2 or more ZMPT101B

Can someone help me with my problem? I can't fix my code. I try to measuring voltage using esp32 and 2 ZMPT101B sensors but it can't work (when i only use 1 sensor zmpt101b it the code work, but when i duplicate the code like this, the code doesn't work for both sesnosrs

  while( true ) {   
    Sensor_1 = analogRead(34);                // read the analog in value:
    inputStats.input(Sensor_1);                   // log to Stats function
    Sensor_2 = analogRead(35);                // read the analog in value:
    inputStats.input(Sensor_2);                   // log to Stats function
        
    if((unsigned long)(millis() - previousMillis) >= printPeriod) {
      previousMillis = millis();                // update time every second
      
      Tegangan1= (intercept + slope * inputStats.sigma())*(49.3231); //Calibartions for offset and amplitude
      Tegangan2= (intercept + slope * inputStats.sigma())*(49.3231); //Calibartions for offset and amplitude

      Serial.print( "Tegangan 1: " );
      Serial.println( Tegangan1 );
      Serial.print( "Tegangan 2: " );
      Serial.println( Tegangan2 );
    }

here is my code

#include <Filters.h>


float testFrequency = 50;                     // signal frequency (Hz)
float windowLength = 100.0/testFrequency;     // how long to average the signal, for statistist

int Sensor_1 = 0;                 
int Sensor_2 = 0;                 

float intercept = 0;  // adjust untuk kalibrasi
float slope = 0.01245;   // adjust untuk kalibrasi
float Tegangan1;      
float Tegangan2;      


unsigned long printPeriod = 1000;     //Refresh rate
unsigned long previousMillis = 0;

void setup() {
  Serial.begin( 9600 );
  Serial.println("AC Voltmeter");
  //delay(5000);
}

void loop() {
  
  RunningStatistics inputStats;               
  inputStats.setWindowSecs( windowLength );
   
  while( true ) {   
    Sensor_1 = analogRead(34);                // read the analog in value:
    inputStats.input(Sensor_1);                   // log to Stats function
    Sensor_2 = analogRead(35);                // read the analog in value:
    inputStats.input(Sensor_2);                   // log to Stats function
        
    if((unsigned long)(millis() - previousMillis) >= printPeriod) {
      previousMillis = millis();                // update time every second
      
      Tegangan1= (intercept + slope * inputStats.sigma())*(49.3231); //Calibartions for offset and amplitude
      Tegangan2= (intercept + slope * inputStats.sigma())*(49.3231); //Calibartions for offset and amplitude

      Serial.print( "Tegangan 1: " );
      Serial.println( Tegangan1 );
      Serial.print( "Tegangan 2: " );
      Serial.println( Tegangan2 );
    }
  }

}

Edit your post n put you code in code tags so it looks like this,

void setup() {
Serial.begin( 9600 );
Serial.println("AC Voltmeter");
//delay(5000);
}

please.

Describe what

this means.

is already a loop, no need to make a loop in a loop with the while true thingy.

does that produce a reading?

Please use code tags.

i just edited my post, can u help me more?

@arfianrusdi, do not cross-post.

Thread locked.