Skip to content

Commit a1a2ba2

Browse files
author
Melissa LeBlanc-Williams
committed
Fixed Travis Errors
1 parent e20caf4 commit a1a2ba2

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

adafruit_featherwing/dotstar_featherwing.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
import board
3535
import adafruit_dotstar as dotstar
3636

37-
# Library Function Ideas
38-
# Gradient (probably just for example)
39-
# 20 40 60 80 100
40-
4137
class DotStarFeatherWing:
4238
"""Class representing a `DotStar FeatherWing
4339
<https://www.adafruit.com/product/3449>`_.
@@ -163,35 +159,35 @@ def shift_right(self, rotate=False):
163159
for y in range(0, self.rows):
164160
for x in range(self.columns - 1, 0, -1):
165161
self._dotstar[y * self.columns + x] = self._dotstar[y * self.columns + x - 1]
166-
lastPixel = self._dotstar[(y + 1) * self.columns - 1] if rotate else 0
167-
self._dotstar[y * self.columns] = lastPixel
162+
last_pixel = self._dotstar[(y + 1) * self.columns - 1] if rotate else 0
163+
self._dotstar[y * self.columns] = last_pixel
168164
self._update()
169165

170166
def shift_left(self, rotate=False):
171167
"""Shift all pixels left"""
172168
for y in range(0, self.rows):
173169
for x in range(0, self.columns - 1):
174170
self._dotstar[y * self.columns + x] = self._dotstar[y * self.columns + x + 1]
175-
lastPixel = self._dotstar[y * self.columns] if rotate else 0
176-
self._dotstar[(y + 1) * self.columns - 1] = lastPixel
171+
last_pixel = self._dotstar[y * self.columns] if rotate else 0
172+
self._dotstar[(y + 1) * self.columns - 1] = last_pixel
177173
self._update()
178174

179175
def shift_up(self, rotate=False):
180176
"""Shift all pixels up"""
181177
for x in range(0, self.columns):
182178
for y in range(self.rows - 1, 0, -1):
183179
self._dotstar[y * self.columns + x] = self._dotstar[(y - 1) * self.columns + x]
184-
lastPixel = self._dotstar[(self.rows - 1) * self.columns + x] if rotate else 0
185-
self._dotstar[x] = lastPixel
180+
last_pixel = self._dotstar[(self.rows - 1) * self.columns + x] if rotate else 0
181+
self._dotstar[x] = last_pixel
186182
self._update()
187183

188184
def shift_down(self, rotate=False):
189185
"""Shift all pixels down"""
190186
for x in range(0, self.columns):
191187
for y in range(0, self.rows - 1):
192188
self._dotstar[y * self.columns + x] = self._dotstar[(y + 1) * self.columns + x]
193-
lastPixel = self._dotstar[x] if rotate else 0
194-
self._dotstar[(self.rows - 1) * self.columns + x] = lastPixel
189+
last_pixel = self._dotstar[x] if rotate else 0
190+
self._dotstar[(self.rows - 1) * self.columns + x] = last_pixel
195191
self._update()
196192

197193
def _update(self):

examples/featherwing_dotstar_palettetest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
rotates through the palette creating a moving rainbow.
44
"""
55

6-
from math import sqrt,cos,sin,radians
6+
from math import sqrt, cos, sin, radians
77
from adafruit_featherwing import dotstar_featherwing
88

99
dotstar = dotstar_featherwing.DotStarFeatherWing()

examples/featherwing_dotstar_simpletest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from time import sleep
77
import random
8-
from math import sqrt,cos,sin,radians
98
from adafruit_featherwing import dotstar_featherwing
109

1110
dotstar = dotstar_featherwing.DotStarFeatherWing()

0 commit comments

Comments
 (0)