LED matrix met Raspberry Pi Pico

Het aansturen van een 128×32 HUB75 RGB LED matrix met een Raspberry Pi Pico.

Zie https://learn.pimoroni.com/article/getting-started-with-interstate-75

Het programmeren doe je met Thonny Python IDE. Met deze IDE kun je software schrijven en direct het programma draaien zonder uploaden. Jouw python script main.py kun je ook overdragen naar de Pi Pico zodat hij stand alone kan draaien.

Zie hier een programma gemaakt voor weekend van de Wetenschap 2023.

main.py
import time
import interstate75
 
i75      = interstate75.Interstate75(display=interstate75.DISPLAY_INTERSTATE75_128X32)
graphics = i75.display
width    = i75.width
height   = i75.height
frame    = 0
 
while True:
    graphics.set_pen(graphics.create_pen(0, 0, 0))
    graphics.clear()
    text_index=round(frame/60)%6
 
    #-------------- Draw moving arrows ----------------
    hue        = frame/200
    saturation = 1
    brightness = 0.4 + 0.4*(text_index>=4 and frame%10>5)
    arrow_x    = -50 + frame%48
 
    graphics.set_font("serif") #Vector font
    graphics.set_thickness(6)  #Font thickness
    graphics.set_pen(graphics.create_pen_hsv(hue, saturation, brightness))
    graphics.text(">>>>>>>", arrow_x, 16, -1, 2)
 
    #-------------- Draw text ----------------
    graphics.set_font("bitmap8")
    graphics.set_pen(graphics.create_pen(255, 255, 255))
 
    if(text_index==0):
        graphics.text("Welkom bij", 16, 8, -1, 2)
 
    if(text_index==1):
        graphics.text("Hackerspace", 10, 1, -1, 2)
        graphics.text("TDvenlo", 22, 17, -1, 2)
 
    if(text_index==2):
        graphics.text("Weekend v.d.", 10, 1, -1, 2)
        graphics.text("Wetenschap", 14, 17, -1, 2)
 
    if(text_index==3):
        graphics.text("2023", 36, 5, -1, 3)
 
    if(text_index>=4):
        graphics.text("Begin hier", 18, 8, -1, 2)
 
    i75.update(graphics)
    time.sleep(0.03)
    frame = frame+1





  • projects/ledmatrix_pipico.txt
  • Last modified: 04/10/2023 13:41
  • by ron