4677 views|3 replies

1w

Posts

25

Resources
The OP
 

ESP8266/ESP32 drives 16x16 dot matrix ws2812 screen [Copy link]

 
效果图:


驱动[code]"""
    ESP8266/ESP32 neopixel 16x16 display drive

    Author: shaoziyang
    Date:   2018.2

    http://www.micropython.org.cn

"""
from machine import Pin
import neopixel

class neo16x16:
    def __init__(self, pin):
        self.np = neopixel.NeoPixel(pin, 256)
        self.color = (0,0,8)
   
    def clear(self):
        self.np.fill((0,0,0))
        self.np.write()

    def set(self, n, color=''):
        if dat!='':
            self.np[n] = color
        else:
            self.np[n] = self.color
        self.np.write()

    def setcolor(self, color):
        self.color = color

    def show(self, dat, offset=0, clear = True, color=''):
        if color != '':
            self.color = color
        if clear:
            self.np.fill((0,0,0))
        for x in range(16):
            for y in range(16):
                if (x+offset)>=len(dat):
                    self.np[x*16+y]=(0,0,0)
                else:
                    if (1<[color="#5E7384]此内容由EEWORLD论坛网友dcexpert原创,如需转载或用于商业用途需征得作者同意并注明出处" [url]http:="" [url]https:="" author:="" code]="" date:="" demo="" div="" else:="" esp32="" esp8266="" from="" github.com="" if="" import="" machine="" master="" mpy-lib="" n="0" n)="" neo16x16="" neo_16x16[="" neopixel="" np="neo16x16(Pin(2))" np.show(npdat,="" npdat="[" offset%2="=0:" pin="" self.np.write()="" self.np[x*16="" shaoziyang="" time="" time.sleep_ms(200)="" tree="" url]="" while="" www.micropython.org.cn[="" y]="self.color" 完整程序:="" 测试程序[code]'''="">
Awesome! Support it!

cool

good

ESP8266/ESP32 drives 16x16 dot matrix ws2812 screen


Latest reply

good  Details Published on 2018-2-15 21:42
 
 

288

Posts

0

Resources
2
 
Awesome! Support it!
 
 
 

3414

Posts

0

Resources
3
 
cool
 
 
 

1903

Posts

0

Resources
4
 
good
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list