本文整理匯總了Python中PyGlow.PyGlow.set_leds方法的典型用法代碼示例。如果您正苦於以下問題:Python PyGlow.set_leds方法的具體用法?Python PyGlow.set_leds怎麽用?Python PyGlow.set_leds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyGlow.PyGlow
的用法示例。
在下文中一共展示了PyGlow.set_leds方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: spaz
# 需要導入模塊: from PyGlow import PyGlow [as 別名]
# 或者: from PyGlow.PyGlow import set_leds [as 別名]
def spaz():
piglow = PyGlow()
for x in range(1,19)+range(18,0,-1):
piglow.set_leds([x], 255).update_leds()
sleep(0.01)
piglow.set_leds([x], 0).update_leds()
sleep(0.05)
示例2: slow_pulse_piglow
# 需要導入模塊: from PyGlow import PyGlow [as 別名]
# 或者: from PyGlow.PyGlow import set_leds [as 別名]
def slow_pulse_piglow(color):
piglow = PyGlow(brightness=PULSE_BRIGHTNESS, pulse=True, speed=5000, pulse_dir=BOTH)
piglow.set_leds(color).update_leds()
示例3: PyGlow
# 需要導入模塊: from PyGlow import PyGlow [as 別名]
# 或者: from PyGlow.PyGlow import set_leds [as 別名]
#
#####
from PyGlow import PyGlow
from time import sleep
pyglow = PyGlow()
try:
while True:
# Choose a set of leds
leds = [1, 3, 5, 11, 13, 15]
# Save them with the brightness you want
pyglow.set_leds(leds, 50)
# Wait to demonstrate...
sleep(3)
# Light up the leds!
pyglow.update_leds()
sleep(3)
# Now we want to shut down the first set
pyglow.set_leds(leds, 0)
# ...build a newer, brighter set
leds = [2, 4, 9]
pyglow.set_leds(leds, 150)
# and update the leds!
pyglow.update_leds()