The project is abandoned and not being updated due to the loss of my interest in MicroPython, as well as bad code in the project.
MerbuzPixel is an improved version of the neopixel library. A 16x16 matrix was tested on a Wemos Mini d1 r1 microcontroller.
Just download the library file and import it into your board!
Just import all from this library
from merbuzpixel import *Or import only what you need
from merbuzpixel import MerbuzPixelmerbuz = MerbuzPixel(pin=4, width=16, height=16)Create instance of class.
pinpin connection to the matrixwidthwidth of matrixheightheight of matrix
Control brightness of matrix
merbuz.setBrightness(brightness=3) brightnessbrightness parameter 0-255
Fill pixel in matrix
merbuz.setPixel(index=0, rgb=(255, 255, 255))indexindex of led in matrixrgbtuple with RGB code
Clear all matrix. Does not require arguments
merbuz.clearMatrix() Fill pixels in current range
merbuz.fillPixels(firstIndex=6, secondIndex=70, rgb=(255, 255, 255))firstIndexfirst index in rangesecondIndexlast index in rangergbtuple with RGB code
Fill background in matrix
merbuz.fillBackground(rgb=(255, 255, 255))rgbtuple with RGB code
Clear pixel of selected index
merbuz.clearPixel(index=0)indexindex of pixel
Draw any image to matrix! Any size
merbuz.drawImage(file_name='place_your_file_name')file_namea file with an encoded image with the .merbuzpixel extension. You can get this file if you use the MerbuzPixelImage library.
10 colors to choose from. You can use them instead of tuple RGB code:
REDGREENBLUEORANGEYELLOWLIGHTBLUEWHITEVIOLETPURPLEPINK
MerbuzPixel.RED
MerbuzPixel.GREEN
MerbuzPixel.BLUE
MerbuzPixel.ORANGE
MerbuzPixel.YELLOW
MerbuzPixel.LIGHTBLUE
MerbuzPixel.WHITE
MerbuzPixel.VIOLET
MerbuzPixel.PURPLE
MerbuzPixel.PINKExample of using color
merbuz.fillBackground(rgb=MerbuzPixel.PINK)Example of using the library
from merbuzpixel import *
merbuz = MerbuzPixel(pin=4, width=16, height=16) # Create class. first - pin of matrix, second - width of matrix, third - height
merbuz.setBrightness(3) # Set brightness 0-255
merbuz.setPixel(index=0, rgb=(255, 255, 255)) # Set pixel, first - index, second - tuple of RGB
merbuz.clearMatrix() # Just clear matrix. All
merbuz.fillPixels(firstIndex=6, secondIndex=70, rgb=(255, 255, 255)) # Fill by index led. First - index of first led, second - index of second led, third - tuple of RGB
merbuz.fillBackground(rgb=MerbuzPixel.PINK) # Fill all matrix. Use rgb as a argument
merbuz.clearPixel(index=0) # Pixel index to clear
merbuz.drawImage(file_name='place_your_file') # Drawing method