def load_light(light, count = 1, duration = 2): try: i = 0 while i < count: light.flare(duration=duration) sleep(duration) i += 1 except KeyboardInterrupt: cleanup()
def main(): setup() try: turn_off_all(config.outputs) current_color.turn_on() config.inputs["BUTTON"].listenBoth(callback=callback) input("\n") gpio.cleanup() except KeyboardInterrupt: gpio.cleanup()
def main(): setup() light_util.loading_sequence_start() input("") light_util.loading_sequence_stop() # processes = multiprocessing.active_children() # for p in processes: # p.terminate() light_util.shutdown_sequence(delay=0.2) cleanup()
def main(): gpio.setup(outputs) light_util.loading_sequence_start(load_count=1, synchronous=True) light_util.shutdown_sequence(delay=0.2) cleanup()
from gpio.interface import cleanup from gpio.config import outputs import gpio.interface as gpio import light_util def main(): gpio.setup(outputs) light_util.loading_sequence_start(load_count=1, synchronous=True) light_util.shutdown_sequence(delay=0.2) cleanup() if __name__ == "__main__": try: main() except KeyboardInterrupt: cleanup()