From 3d7d4f99b4c34d87b7244c50c4aac1f617ccd99c Mon Sep 17 00:00:00 2001 From: Fisch Date: Sat, 6 Jan 2018 19:50:59 +0100 Subject: [PATCH] rotate display by 180 degrees --- matrix.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/matrix.py b/matrix.py index 718d266..cd25293 100644 --- a/matrix.py +++ b/matrix.py @@ -50,6 +50,8 @@ class FlipdotSim(): self.udpHostSocket.close() def sendToMatrix(self,imageArray,displayid=0): + imageArray=[x for x in reversed(imageArray)] #Rotated Image + data=np.zeros(int(WIDTH*HEIGHT/8),dtype=np.uint8) imageArray=np.hstack( (np.array(imageArray,dtype=np.uint8),np.zeros(len(data)*8-len(imageArray),dtype=np.uint8) )) print("imageArray size="+str(len(imageArray))) @@ -150,9 +152,9 @@ def matrixSetup(ser,displayid=0): ser.write(chr(2).encode()) ser.write(b'B') #command char if displayid==0: - ser.write(b'0') #display id 0 or 1 + ser.write(b'1') #display id 0 or 1 elif displayid==1: - ser.write(b'1') + ser.write(b'0') #ser.write(b'00000000000') ser.write(b'00000000000') #alignment ser.write(chr(27).encode()) #oneB