Window opener opens window again and again due to Void loop

How is your endschalter connected to the Arduino? Which output pin causes the motor to run toward the switch? Is the pin switched HIGH or LOW to make the motor run?