Python Forum
Address WS2811 LED matrix attached to Raspberry Pi 3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Address WS2811 LED matrix attached to Raspberry Pi 3
#1
Hi guys!
I ran into some trouble programming a DIY LED panel that is attached to my Raspberry Pi 3.
The hardware setup is like this:
  • a long stripe of WS2811 LEDs cut into pieces of 24 each
  • 4 of these pieces arranged horizontally, making a 24x4 LED matrix
  • the strips are soldered together on the left and right so they all get signal and power
  • all done according to this tutorial: https://www.raspberrypi.org/forums/viewt...9&t=201753 with the exception that my panel is directly connected to the pi - no other hardware or power supply is necessary.
Since I'm completely new to python and all my research led me only to failures I want to ask you for advice. The setup I explained above is working perfectly fine. I just want the LED matrix to show something else than the "strandtest.py" has to offer: https://github.com/jgarff/rpi_ws281x/blo...andtest.py

I'm just unable to change the code to get the result that I want. The "strandtest.py" runs several test patterns, that look really nice, but I want:
A) Scroll any given text
B) display an audio spectrum analyzer based on sound input

Is that possible? Can you help me with that?
Reply
#2
I made some humble progress and want to specify my problem a little further.
I installed the PIMODORI'S "unicornHAT" library:
curl https://get.pimoroni.com/unicornhat | bash
The scripts that came with it allow me to display example graphics on my DIY panel - so far so good.
The problem is, that I don't know how to customize the layout (from 8x8 to 24x4). The graphics are displayed fractured - of course - and only part of my panel is used.

Here is an example ("simple.py"). Can you help me customizing the code?
#!/usr/bin/env python

import time

import unicornhat as unicorn


print("""Simple

Turns each pixel on in turn and updates the display.

If you're using a Unicorn HAT and only half the screen lights up, 
edit this example and  change 'unicorn.AUTO' to 'unicorn.HAT' below.
""")

unicorn.set_layout(unicorn.HAT)
unicorn.rotation(0)
unicorn.brightness(0.5)
width,height=unicorn.get_shape()


for y in range(height):
  for x in range(width):
    unicorn.set_pixel(x,y,255,0,255)
    unicorn.show()
    time.sleep(0.05)

time.sleep(1)
Reply
#3
You could perhaps write text in four pixels font
Reply
#4
That's missing the point...
I can't address the panel properly - the image appears fractured.
Reply
#5
Let me elaborate...
pi@raspberrypi:~ $ sudo ./rpi_ws281x/test -sgbr -x24 -y4 -g18 -c
Runs awesome! It generates a scrolling rainbow over the whole panel!
But I don't find a way to make it display stuff THAT I WANT...

In other folders, such as
pi@raspberrypi:~/Pimoroni/unicornhat/examples
There are a couple of cool example scripts that would really help me,
but they don't run over the whole panel and appear fractured!

How can I get these two together...?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Check if two matrix are equal and of not add the matrix to the list quest 3 817 Jul-10-2023, 02:41 AM
Last Post: deanhystad
  How to multiply a matrix with herself, until the zero matrix results peanutbutterandjelly 3 3,350 May-03-2021, 06:30 AM
Last Post: Gribouillis
  Spawning a new process that is not attached to python cman234 3 1,887 Apr-25-2020, 05:24 PM
Last Post: cman234
  My objective is to get the shape parameters of the particles in attached image chad221 0 1,778 Oct-26-2019, 10:27 AM
Last Post: chad221
  Parsing Attached .MSG Files with Python3 ericl42 1 3,668 Apr-12-2019, 06:28 PM
Last Post: ericl42
Question [Help] Convert integer to Roman numerals? {Screenshot attached} vanicci 10 9,133 Aug-06-2018, 05:19 PM
Last Post: vanicci
  [Help] sorted() in while loop with user's input() {Screenshot attached} vanicci 5 4,005 Aug-04-2018, 08:59 PM
Last Post: vanicci
Question [Help] How to end While Loop using counter? {Screenshot attached} vanicci 2 3,080 Aug-02-2018, 10:09 PM
Last Post: vanicci
  matrix from matrix python numpy array shei7141 1 3,684 Jan-16-2017, 06:10 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020