LED matrix met Raspberry Pi Pico
Benodigde onderdelen
- 2x HUB75 P3 RGB led matrix 64×32
- Pimoroni Interstate 75 W RGB LED Matrix Driver
- Deze driver bevat een Raspberry Pi Pico W
- 5V voeding die voldoende stroom kan leveren. Ik heb een voeding met 5V 10A gebruikt.
Software
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.
Programma WVDW 2023
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