Added icon upload script, fixed ledmatrix for different layout

This commit is contained in:
2021-01-07 11:02:50 +00:00
parent 1abe7b1773
commit 3fafd9bf35
3 changed files with 46 additions and 10 deletions

View File

@@ -77,13 +77,15 @@ class LedMatrix:
# one step to the east, and then south to north, before the cycle
# starts over.
stride = self.stride
phys_addr = ((x-1)%self.panelcolumn) + ((y-1)*self.panelcolumn) + (self.round_down((x-1)/self.panelcolumn) * self.panelcolumn * self.panelcolumn)
phys_addr = int(((x)%self.panelcolumn) + ((y)*self.panelcolumn) + (self.round_down((x)/self.panelcolumn) * self.panelcolumn * self.panelcolumn))
#MOD(x-1;panelCol) + ((y-1)*panelCol) + (FLOOR.MATH((x-1)/panelCol;1)*panelCol*panelRow)
#print("xy_to_phys x=",x," y=",y," phys=",phys_addr)
# if x & 1:
# phys_addr += stride - 1 - y
# else:
# phys_addr += y
# return phys_addr
return phys_addr
def get_pixel(self, x, y):
"""