本文整理汇总了Python中dotstar.Adafruit_DotStar.clear方法的典型用法代码示例。如果您正苦于以下问题:Python Adafruit_DotStar.clear方法的具体用法?Python Adafruit_DotStar.clear怎么用?Python Adafruit_DotStar.clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dotstar.Adafruit_DotStar
的用法示例。
在下文中一共展示了Adafruit_DotStar.clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: btn
# 需要导入模块: from dotstar import Adafruit_DotStar [as 别名]
# 或者: from dotstar.Adafruit_DotStar import clear [as 别名]
if btn() != pin_go: # Button released?
strip.show(clearBuf)
elif b == 2:
# Decrease paint duration
if speed_pixel > 0:
speed_pixel -= 1
duration = (min_time + time_range *
speed_pixel / (num_leds - 1))
strip.setPixelColor(speed_pixel, 0x000080)
strip.show()
startTime = time.time()
while (btn() == 2 and ((time.time() - startTime) <
rep_time)): continue
strip.clear()
strip.show()
elif b == 3:
# Increase paint duration (up to 10 sec maximum)
if speed_pixel < num_leds - 1:
speed_pixel += 1
duration = (min_time + time_range *
speed_pixel / (num_leds - 1))
strip.setPixelColor(speed_pixel, 0x000080)
strip.show()
startTime = time.time()
while (btn() == 3 and ((time.time() - startTime) <
rep_time)): continue
strip.clear()
strip.show()
elif b == 4 and filename != None: