- this_switch = gpio.input(25)
- logger.debug("This: {0}, Last: {1}".format(this_switch, last_switch))
- if this_switch and not last_switch:
- sounds[0].play()
- last_switch = this_switch
- logger.info("Started playing")
- if not this_switch and last_switch:
- sounds[0].stop()
- last_switch = this_switch
- logger.info("Stopped playing")