def motor2(mag): # If needed, use on/off motor instead of PWM GPIO.output(MOTORPIN, True) time.sleep(int(mag)) GPIO.output(MOTORPIN, False) return