def _init():
global _t_poll, _bus
if _bus is not None:
return
_bus = smbus.SMBus(1)
_bus.write_byte_data(ADDR, REG_CONFIG, 0b00011111)
_bus.write_byte_data(ADDR, REG_POLARITY, 0b00000000)
_bus.write_byte_data(ADDR, REG_OUTPUT, 0b00000000)
_t_poll = Thread(target=_run)
_t_poll.daemon = True
_t_poll.start()
set_pixel(0, 0, 0)
atexit.register(_quit)
评论列表
文章目录