Beispiel #1
0
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()
Beispiel #2
0
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()
Beispiel #3
0
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()
Beispiel #4
0
def main():
    gpio.setup(outputs)
    light_util.loading_sequence_start(load_count=1, synchronous=True)
    light_util.shutdown_sequence(delay=0.2)
    cleanup()
Beispiel #5
0
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()