@@ -100,16 +100,17 @@ def attempt_reconnect(self):
100
100
self .nuimoMenue .reconnect ()
101
101
102
102
def showRotationState (self , percent ):
103
+
103
104
fullRotationString = str (
104
- " * "
105
+ " *** "
105
106
" * * "
106
107
" * * "
107
108
"* *"
108
109
"* *"
109
110
"* *"
110
111
" * * "
111
112
" * * "
112
- " * "
113
+ " ** * "
113
114
)
114
115
fullRotationIsCircular = True
115
116
'''
@@ -148,30 +149,27 @@ def showRotationState(self, percent):
148
149
149
150
if (percent != 0 ):
150
151
ledsToShow = math .ceil (percent * ledCnt / 100 )
151
- print ("leds:" + str (ledsToShow ))
152
152
currentRotationString = list ()
153
153
itCnt = 0
154
-
155
154
for c in fullRotationString :
155
+ column = itCnt % 9
156
+ row = itCnt // 9
156
157
itCnt += 1
157
- if c == "*" and ledsToShow != 0 and (itCnt % 9 > 4 or itCnt % 9 == 0 or not fullRotationIsCircular ):
158
+ if c == "*" and ledsToShow != 0 and (not fullRotationIsCircular or column > 4 or row == 0 and column == 4 ):
158
159
ledsToShow -= 1
159
160
currentRotationString .append ("*" )
160
161
else :
161
162
currentRotationString .append (" " )
162
163
163
- itCnt = 0
164
164
if fullRotationIsCircular :
165
- first = True
166
- for c in fullRotationString [::- 1 ]:
167
- itCnt += 1
168
- if c == "*" and ledsToShow != 0 and (itCnt % 9 > 4 or itCnt % 9 == 0 ):
169
- if (not first ):
170
- ledsToShow -= 1
171
- index = int (abs (itCnt - 81 ))
172
- print ("print Led:" + str (index ))
173
- currentRotationString [index ] = "*"
174
- first = False
165
+ itCnt = 80
166
+ while (itCnt >= 0 ):
167
+ column = itCnt % 9
168
+ row = itCnt // 9
169
+ if fullRotationString [itCnt ] == "*" and ledsToShow != 0 and column <= 4 and not (row == 0 and column == 4 ):
170
+ ledsToShow -= 1
171
+ currentRotationString [itCnt ] = "*"
172
+ itCnt -= 1
175
173
176
174
matrix = nuimo .LedMatrix ("" .join (currentRotationString ))
177
175
self .nuimoMenue .controller .display_matrix (matrix = matrix ,fading = True , ignore_duplicates = True )
0 commit comments