pyglow.pulse(14, val, speedval) pyglow.pulse(15, val, speedval) pyglow.pulse(16, val, speedval) pyglow.pulse(17, val, speedval) pyglow.pulse(18, val, speedval) arm_choice = input("Pick a number between 1 and 3: ") if arm_choice < 0 or arm_choice > 3: sys.exit() pyglow.pulse_arm(arm_choice, val, speedval) pulse_choice = input("Pulse all? 1/0: ") if pulse_choice == 1: pyglow.pulse_all(val, speedval) else : print("Oh, okay then. :(") pulse_pattern = input("What pattern do you want? Choice between 1-5: ") if pulse_pattern == 1: pyglow.pulse_all(val, speedval) elif pulse_pattern == 2: pyglow.pulse_arm(1, val, speedval) elif pulse_pattern == 3: pyglow.pulse(1, val, speedval) pyglow.pulse_arm(3, val, speedval) elif pulse_pattern == [4,5]: print("nothing here yet!") else:
## ## PyGlow ## ## python module to control Pimoronis PiGlow (http://shop.pimoroni.com/products/piglow) ## ## * pulsetest.py - test the pulsing light feature ## from pyglow import PyGlow pyglow = PyGlow() val = input("Maximum Brightness: ") speedval = input("Speed (Try 500 as a default): ") pyglow.all(0) print("Pulsing 1 Light") pyglow.pulse(1, val, speedval) print("Pulsing Arms") pyglow.pulse_arm(1, val, speedval) pyglow.pulse_arm(2, val, speedval) pyglow.pulse_arm(3, val, speedval) print("Pulsing All") pyglow.pulse_all(val, speedval)