Me cuesta entender el codigo

Te doy varios consejos.

  1. Indenta el codigo, luego te sera mucho mas legible
  2. Usa algún simulador básico como SimulIDE o Tinkercad.
  3. Pon tantos print() como sean necesarios para que veas en el monitor serie lo que ocurre.

Algo asi mira:

int pot[2] = {0, 0};
int ulPot[2] = {0, 0};

void setup(){
   Serial.begin(57600);
}

void loop() {
   for(int i = 0; i < 2 ; i++){
      Serial.print("i = ");
      Serial.print(i);
      pot[i] = analogRead(i) / 8;
      Serial.print(" Pot(");
      Serial.print(i);
      Serial.print(") = ");
      Serial.println(pot[i]);
      delay(10);      
   }
   for (int i = 0; i < 2; i++){
      if (pot[i] != ulPot[1]){
           ulPot[i] = pot[i];
      }
   }
}

Busca en Youtube videos tutoriales de Arduino en español. Hay muchos.