三木社区

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 404|回复: 0
打印 上一主题 下一主题

APA102驱动

[复制链接]

1657

主题

1684

帖子

5684

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5684
跳转到指定楼层
楼主
发表于 2017-7-12 08:29:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. from machine import Pin
  2. from apa102 import APA102
  3. clock = Pin(14, Pin.OUT)     # set GPIO14 to output to drive the clock
  4. data = Pin(13, Pin.OUT)      # set GPIO13 to output to drive the data
  5. apa = APA102(clock, data, 8) # create APA102 driver on the clock and the data pin for 8 pixels
  6. apa[0] = (255, 255, 255, 31) # set the first pixel to white with a maximum brightness of 31
  7. apa.write()                  # write data to all pixels
  8. r, g, b, brightness = apa[0] # get first pixel colour
复制代码


回复

使用道具 举报

Archiver|手机版|小黑屋|三木电子社区 ( 辽ICP备11000133号-4 )

辽公网安备 21021702000620号

GMT+8, 2026-3-6 00:08 , Processed in 0.025206 second(s), 23 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表