I am using a 3d array to control a RGB Led matrix via a micro controller using MicroPython. I can't use Numpy to make the array. But it needs to be filled in order for the rest of the code to call on versus positions. It would be nice if it can be done by a function so that I can use the code on different sized Led panels.
Right now I write the whole thing out but that does not scale and it slows down the editor a lot. the other thing that I have tried is a function to do it. but I don't know how to add the value instead of the reference.
def setbase():
base2 = []
for y in range(WIDTH):
base2.insert(y,[0,0,0])
for x in range(HEIGHT):
base.insert(x,base2)