https://github.com/CatMeowByte/LED_panel_upy
  
  
    MicroPython driver module for Panel P10 32*16 Matrix display and its variants. 
    https://github.com/CatMeowByte/LED_panel_upy
  
led-matrix led-matrix-display led-matrix-library led-matrix-panel micropython micropython-driver micropython-lib p10-led-module
        Last synced: 6 months ago 
        JSON representation
    
MicroPython driver module for Panel P10 32*16 Matrix display and its variants.
- Host: GitHub
 - URL: https://github.com/CatMeowByte/LED_panel_upy
 - Owner: CatMeowByte
 - Created: 2023-09-16T17:35:29.000Z (about 2 years ago)
 - Default Branch: main
 - Last Pushed: 2023-09-26T04:23:01.000Z (about 2 years ago)
 - Last Synced: 2024-08-05T00:07:06.684Z (over 1 year ago)
 - Topics: led-matrix, led-matrix-display, led-matrix-library, led-matrix-panel, micropython, micropython-driver, micropython-lib, p10-led-module
 - Language: Python
 - Homepage:
 - Size: 8.79 KB
 - Stars: 1
 - Watchers: 1
 - Forks: 0
 - Open Issues: 1
 - 
            Metadata Files:
            
- Readme: README.MD
 
 
Awesome Lists containing this project
- awesome-micropython - LED_panel_upy - MicroPython driver module for Panel P10 32x16 Matrix display and its variants. (Libraries / Display)
 
README
          # LED Panel Driver Module

A Minimal MicroPython driver module for Panel P10 32*16 Matrix display and its variants, to handle 1/4 scanline and its unconventional byte data arrangements.
## Usage Example
```python
from framebuf import FrameBuffer, MONO_HLSB
from machine import Pin
from led_panel import LEDPanel
# Init
led = LEDPanel(
  pe = Pin(14, Pin.OUT),
  pa = Pin(13, Pin.OUT),
  pb = Pin(12, Pin.OUT),
  pclk = Pin(18, Pin.OUT),
  plat = Pin(19, Pin.OUT),
  pdr = Pin(23, Pin.OUT),
  freq = 1000,
  duty = 1
)
w = 32
h = 16
# FrameBuffer
ba = bytearray((w * h) // 8) # 1 bpp
fb = FrameBuffer(ba, w, h, MONO_HLSB)
# Main code
def main():
  x = 0
  while 1:
    fb.fill(0)
    fb.text("Hi,all!", x+w, 0, 1)
    fb.text("WOW!", 0, 9, 1)
    
    x = (x-1) % -96
    
    # Mandatory pause
    # Can be used as sleep
    await led.hold(50 / 1000) # msec
# Execute
# Must be last
led.run(ba, main)
```
The `hold()` function is a convenient utility for adding a mandatory asyncio pause without the need to import asyncio into the main code. It allows to add a pause in seconds, including float and fractions, or leave it empty for the shortest possible pause.
## License
This project is provided under the [GPLv3+ License](https://spdx.org/licenses/GPL-3.0-or-later.html). Feel free to use, modify, and distribute it according to the terms of the license.