def loop():
  value = sensor.value or 1 # value is initially None
  value = value / 2

  buzzer.on()
  sleep(value)
  buzzer.off()
  sleep(value)
dataset/ETHPy150Open theycallmeswift/BreakfastSerial/examples/buzzer.py/loop/original