I wanted to try turning the rotational motion of the motor into a linear motion, so I decided to make my tile similar to an automatic door.

while True:
    # Read the sensor once per cycle.
    sensor_level = sensor.value
    if sensor_level < 53000:
        print(sensor_level)
        pwm = 0.6
        print("PWM:", pwm)
        driver.write(0, -pwm)
        time.sleep(1.2)
        driver.write(0, pwm)
        print('here')
        time.sleep(1.2)
    driver.write(0,0)