Hello there,
I would like wrote some code to use my rgb led matrix.
My issue is when I run my code I got this error in thony, and white line appear on the led panel:
“Press CTRL-C to stop sample
Can’t set realtime thread priority=99: Operation not permitted.
You are probably not running as root ?
This will seriously mess with color stability and flicker
of the matrix. Please run as root
(e.g. by invoking this
program with sudo
), or setting the capability on this
binary by calling
sudo setcap ‘cap_sys_nice=eip’ /usr/bin/python3.7”
My code is the following:
#!/usr/bin/env python
from samplebase import SampleBase
from rgbmatrix import RGBMatrix, RGBMatrixOptions, graphics
import time
class Show(SampleBase):
def __init__(self, *args, **kwargs):
super(Show, self).__init__(*args, **kwargs)
def run(self):
ops = RGBMatrixOptions()
ops.rows = 20
ops.cols = 40
ops.chain_length = 2
ops.parallel = 2
ops.multiplexing = 10
ops.row_address_type = 4
ops.drop_privileges = False #This line should help but it doesn't :(
matrix = RGBMatrix(options = ops)
#matrix.Clear()
graphics.DrawLine(matrix, 0, 40, 0, 39, graphics.Color(255,0,0))
time.sleep(2)
# Main function
if __name__ == "__main__":
show = Show()
if (not show.process()):
show.print_help()