1 Star 0 Fork 0

Walkline/MicroPython WS2812 Digital Effect

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
config.py 2.68 KB
一键复制 编辑 原始数据 按行查看 历史
"""
Copyright © 2024 Walkline Wang (https://walkline.wang)
Gitee: https://gitee.com/walkline/micropython-ws2812-digital-effect
"""
import esp
import esp32
# esp.osdebug(None) # 注释此行可显示详细调试信息
# channel 0/1 for esp32c3
# esp32.RMT.bitstream_channel(1)
class Config(object):
IN = 0
OUT = 1
DIGITALS_1 = {
0: {
IN : (0x1004, 0x380e, 0x7c1f, 0x7e3f, ),
OUT: (0x7c1f, 0x380e, 0x1004, 0x0000, ),
},
1: {
IN : (0x0080, 0x01c0, 0x03e0, 0x47e1, ),
OUT: (0x03e0, 0x01c0, 0x0080, 0x0000, ),
},
2: {
IN : (0x0080, 0x1084, 0x188c, 0x1c9c, 0x1ebc, 0x5ebd, ),
OUT: (0x1ebc, 0x1c9c, 0x188c, 0x1084, 0x0080, 0x0000, ),
},
3: {
IN : (0x0080, 0x1084, 0x108e, 0x109f, 0x12bf, 0x56bf, ),
OUT: (0x12bf, 0x109f, 0x108e, 0x1084, 0x0080, 0x0000, ),
},
4: {
IN : (0x0080, 0x1084, 0x308e, 0x709f, ),
OUT: (0x308e, 0x1084, 0x0080, 0x0000, ),
},
5: {
IN : (0x0080, 0x1084, 0x3086, 0x7087, 0x72a7, 0x76b7, ),
OUT: (0x72a7, 0x7087, 0x3086, 0x1084, 0x0080, 0x0000, ),
},
6: {
IN : (0x0080, 0x1084, 0x3886, 0x7c87, 0x7ea7, 0x7eb7, ),
OUT: (0x7ea7, 0x7c87, 0x3886, 0x1084, 0x0080, 0x0000, ),
},
7: {
IN : (0x0004, 0x000e, 0x001f, 0x021f, 0x421f, ),
OUT: (0x021f, 0x001f, 0x000e, 0x0004, 0x0000, ),
},
8: {
IN : (0x0080, 0x1084, 0x388e, 0x7c9f, 0x7ebf, ),
OUT: (0x7c9f, 0x388e, 0x1084, 0x0080, 0x0000, ),
},
9: {
IN : (0x0080, 0x1084, 0x308e, 0x709f, 0x72bf, 0x76bf, ),
OUT: (0x72bf, 0x709f, 0x308e, 0x1084, 0x0080, 0x0000, ),
},
}
DIGITALS_2 = {
0: {
IN : (0x001f, 0x03f1, 0x7e3f, ),
OUT: (0x47e0, 0x03e0, 0x0000, ),
},
1: {
IN : (0x0011, 0x023f, 0x47e1, ),
OUT: (0x7c20, 0x0020, 0x0000, ),
},
2: {
IN : (0x0017, 0x02f5, 0x5ebd, ),
OUT: (0x57a0, 0x03a0, 0x0000, ),
},
3: {
IN : (0x0015, 0x02b5, 0x56bf, ),
OUT: (0x57e0, 0x03e0, 0x0000, ),
},
4: {
IN : (0x001c, 0x0384, 0x709f, ),
OUT: (0x13e0, 0x03e0, 0x0000, ),
},
5: {
IN : (0x001d, 0x03b5, 0x76b7, ),
OUT: (0x56e0, 0x02e0, 0x0000, ),
},
6: {
IN : (0x001f, 0x03f5, 0x7eb7, ),
OUT: (0x56e0, 0x02e0, 0x0000, ),
},
7: {
IN : (0x0010, 0x0210, 0x421f, ),
OUT: (0x43e0, 0x03e0, 0x0000, ),
},
8: {
IN : (0x001f, 0x03f5, 0x7ebf, ),
OUT: (0x57e0, 0x03e0, 0x0000, ),
},
9: {
IN : (0x001d, 0x03b5, 0x76bf, ),
OUT: (0x57e0, 0x03e0, 0x0000, ),
},
}
DIGITALS_3 = {
0: 0x7e3f,
1: 0x47e1,
2: 0x5ebd,
3: 0x56bf,
4: 0x709f,
5: 0x76b7,
6: 0x7eb7,
7: 0x421f,
8: 0x7ebf,
9: 0x76bf,
}
class Pin(object):
DIN = 1
class Matrix(object):
WIDTH = 9
HEIGHT = 6
class Font(object):
WIDTH = 3
HEIGHT = 5
class Colors(object):
BLACK = (0, 0, 0)
BRIGHT = (41, 41, 0)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/walkline/micropython-ws2812-digital-effect.git
git@gitee.com:walkline/micropython-ws2812-digital-effect.git
walkline
micropython-ws2812-digital-effect
MicroPython WS2812 Digital Effect
master

搜索帮助