Skip to content

Commit 8f8d345

Browse files
author
Melissa LeBlanc-Williams
committed
fixed merge conflict
2 parents f9f0d73 + bb1bf82 commit 8f8d345

11 files changed

+445
-33
lines changed

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ These drivers depends on:
2626
* `Seesaw <https://github.com/adafruit/Adafruit_CircuitPython_seesaw>`_
2727
* `HT16K33 <https://github.com/adafruit/Adafruit_CircuitPython_HT16K33>`_
2828
* `DotStar <https://github.com/adafruit/Adafruit_CircuitPython_DotStar>`_
29+
* `NeoPixel <https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel>`_
2930

3031
Please ensure all dependencies are available on the CircuitPython filesystem.
3132
This is easily achieved by downloading

adafruit_featherwing/dotstar_featherwing.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(self, clock=board.D13, data=board.D11, brightness=0.2):
4848
self.rows = 6
4949
self.columns = 12
5050
self._auto_write = True
51-
self._dotstar = dotstar.DotStar(clock, data, self.rows * self.columns,
51+
self._display = dotstar.DotStar(clock, data, self.rows * self.columns,
5252
brightness=brightness, auto_write=False)
5353

5454
def __setitem__(self, indices, value):
@@ -63,7 +63,7 @@ def __setitem__(self, indices, value):
6363
a single, longer int that contains RGB values, like 0xFFFFFF
6464
brightness, if specified should be a float 0-1
6565
"""
66-
self._dotstar[self._get_index(indices)] = value
66+
self._display[self._get_index(indices)] = value
6767
self._update()
6868

6969
def __getitem__(self, indices):
@@ -73,7 +73,7 @@ def __getitem__(self, indices):
7373
a slice of DotStar indexes to retrieve
7474
a single int that specifies the DotStar index
7575
"""
76-
return self._dotstar[self._get_index(indices)]
76+
return self._display[self._get_index(indices)]
7777

7878
def _get_index(self, indices):
7979
"""
@@ -119,7 +119,7 @@ def fill(self, color=0):
119119
dotstar.fill() # Clear all lit DotStars
120120
121121
"""
122-
self._dotstar.fill(color)
122+
self._display.fill(color)
123123
self._update()
124124

125125
def show(self):
@@ -142,7 +142,7 @@ def show(self):
142142
dotstar.show() # Update the DotStars
143143
144144
"""
145-
self._dotstar.show()
145+
self._display.show()
146146

147147
def shift_right(self, rotate=False):
148148
"""
@@ -164,22 +164,22 @@ def shift_right(self, rotate=False):
164164
dotstar[6, 3] = (0, 255, 0)
165165
166166
# Rotate it off the screen
167-
for i in range(0, 11):
167+
for i in range(0, dotstar.columns - 1):
168168
dotstar.shift_right(True)
169169
time.sleep(.1)
170170
171171
time.sleep(1)
172172
# Shift it off the screen
173-
for i in range(0, 11):
173+
for i in range(0, dotstar.columns - 1):
174174
dotstar.shift_right()
175175
time.sleep(.1)
176176
177177
"""
178178
for y in range(0, self.rows):
179-
last_pixel = self._dotstar[(y + 1) * self.columns - 1] if rotate else 0
179+
last_pixel = self._display[(y + 1) * self.columns - 1] if rotate else 0
180180
for x in range(self.columns - 1, 0, -1):
181-
self._dotstar[y * self.columns + x] = self._dotstar[y * self.columns + x - 1]
182-
self._dotstar[y * self.columns] = last_pixel
181+
self._display[y * self.columns + x] = self._display[y * self.columns + x - 1]
182+
self._display[y * self.columns] = last_pixel
183183
self._update()
184184

185185
def shift_left(self, rotate=False):
@@ -202,22 +202,22 @@ def shift_left(self, rotate=False):
202202
dotstar[6, 3] = (0, 255, 0)
203203
204204
# Rotate it off the screen
205-
for i in range(0, 11):
205+
for i in range(0, dotstar.columns - 1):
206206
dotstar.shift_left(True)
207207
time.sleep(.1)
208208
209209
time.sleep(1)
210210
# Shift it off the screen
211-
for i in range(0, 11):
211+
for i in range(0, dotstar.columns - 1):
212212
dotstar.shift_left()
213213
time.sleep(.1)
214214
215215
"""
216216
for y in range(0, self.rows):
217-
last_pixel = self._dotstar[y * self.columns] if rotate else 0
217+
last_pixel = self._display[y * self.columns] if rotate else 0
218218
for x in range(0, self.columns - 1):
219-
self._dotstar[y * self.columns + x] = self._dotstar[y * self.columns + x + 1]
220-
self._dotstar[(y + 1) * self.columns - 1] = last_pixel
219+
self._display[y * self.columns + x] = self._display[y * self.columns + x + 1]
220+
self._display[(y + 1) * self.columns - 1] = last_pixel
221221
self._update()
222222

223223
def shift_up(self, rotate=False):
@@ -240,22 +240,22 @@ def shift_up(self, rotate=False):
240240
dotstar[6, 3] = (0, 255, 0)
241241
242242
# Rotate it off the screen
243-
for i in range(0, 5):
243+
for i in range(0, dotstar.rows - 1):
244244
dotstar.shift_up(True)
245245
time.sleep(.1)
246246
247247
time.sleep(1)
248248
# Shift it off the screen
249-
for i in range(0, 5):
249+
for i in range(0, dotstar.rows - 1):
250250
dotstar.shift_up()
251251
time.sleep(.1)
252252
253253
"""
254254
for x in range(0, self.columns):
255-
last_pixel = self._dotstar[(self.rows - 1) * self.columns + x] if rotate else 0
255+
last_pixel = self._display[(self.rows - 1) * self.columns + x] if rotate else 0
256256
for y in range(self.rows - 1, 0, -1):
257-
self._dotstar[y * self.columns + x] = self._dotstar[(y - 1) * self.columns + x]
258-
self._dotstar[x] = last_pixel
257+
self._display[y * self.columns + x] = self._display[(y - 1) * self.columns + x]
258+
self._display[x] = last_pixel
259259
self._update()
260260

261261
def shift_down(self, rotate=False):
@@ -278,30 +278,30 @@ def shift_down(self, rotate=False):
278278
dotstar[6, 3] = (0, 255, 0)
279279
280280
# Rotate it off the screen
281-
for i in range(0, 5):
281+
for i in range(0, dotstar.rows - 1):
282282
dotstar.shift_down(True)
283283
time.sleep(.1)
284284
285285
time.sleep(1)
286286
# Shift it off the screen
287-
for i in range(0, 5):
287+
for i in range(0, dotstar.rows - 1):
288288
dotstar.shift_down()
289289
time.sleep(.1)
290290
291291
"""
292292
for x in range(0, self.columns):
293-
last_pixel = self._dotstar[x] if rotate else 0
293+
last_pixel = self._display[x] if rotate else 0
294294
for y in range(0, self.rows - 1):
295-
self._dotstar[y * self.columns + x] = self._dotstar[(y + 1) * self.columns + x]
296-
self._dotstar[(self.rows - 1) * self.columns + x] = last_pixel
295+
self._display[y * self.columns + x] = self._display[(y + 1) * self.columns + x]
296+
self._display[(self.rows - 1) * self.columns + x] = last_pixel
297297
self._update()
298298

299299
def _update(self):
300300
"""
301301
Update the Display automatically if auto_write is set to True
302302
"""
303303
if self._auto_write:
304-
self._dotstar.show()
304+
self._display.show()
305305

306306
@property
307307
def auto_write(self):
@@ -356,9 +356,9 @@ def brightness(self):
356356
dotstar.brightness = 0.3
357357
358358
"""
359-
return self._dotstar.brightness
359+
return self._display.brightness
360360

361361
@brightness.setter
362362
def brightness(self, brightness):
363-
self._dotstar.brightness = min(max(brightness, 0.0), 1.0)
363+
self._display.brightness = min(max(brightness, 0.0), 1.0)
364364
self._update()

0 commit comments

Comments
 (0)