本文整理汇总了Python中dotstar.Adafruit_DotStar.getPixels方法的典型用法代码示例。如果您正苦于以下问题:Python Adafruit_DotStar.getPixels方法的具体用法?Python Adafruit_DotStar.getPixels怎么用?Python Adafruit_DotStar.getPixels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dotstar.Adafruit_DotStar
的用法示例。
在下文中一共展示了Adafruit_DotStar.getPixels方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: bytearray
# 需要导入模块: from dotstar import Adafruit_DotStar [as 别名]
# 或者: from dotstar.Adafruit_DotStar import getPixels [as 别名]
power_settings = (1450, 1550) # Battery avg and peak current
# INITIALIZATION -----------------------------------------------------------
# Set control pins to inputs and enable pull-up resistors.
# Buttons should connect between these pins and ground.
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin_go , GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(pin_prev , GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(pin_next , GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(pin_slower, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(pin_faster, GPIO.IN, pull_up_down=GPIO.PUD_UP)
strip.begin() # Initialize SPI pins for output
ledBuf = strip.getPixels() # Pointer to 'raw' LED strip data
clearBuf = bytearray([0xFF, 0, 0, 0] * num_leds)
imgNum = 0 # Index of currently-active image
duration = 2.0 # Image paint time, in seconds
filename = None # List of image files (nothing loaded yet)
lightpaint = None # LightPaint object for currently-active image (none yet)
# If a mouse is plugged in, set up epoll for sensing position
if os.path.exists(mousefile):
dev = InputDevice(eventfile)
# Register mouse descriptor with epoll
epoll = select.epoll()
epoll.register(dev.fileno(), select.EPOLLIN)
print 'Using mouse for positional input'