1
- # The MIT License (MIT)
1
+ # SPDX-FileCopyrightText: Tony DiCola 2017 for Adafruit Industries
2
2
#
3
- # Copyright (c) 2017 Tony DiCola
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
3
+ # SPDX-License-Identifier: MIT
22
4
23
5
"""
24
6
`adafruit_is31fl3731`
@@ -232,13 +214,11 @@ def frame(self, frame=None, show=True):
232
214
return None
233
215
234
216
def audio_sync (self , value = None ):
235
- """Set the audio sync feature register
236
- """
217
+ """Set the audio sync feature register"""
237
218
return self ._register (_CONFIG_BANK , _AUDIOSYNC_REGISTER , value )
238
219
239
220
def audio_play (self , sample_rate , audio_gain = 0 , agc_enable = False , agc_fast = False ):
240
- """Controls the audio play feature
241
- """
221
+ """Controls the audio play feature"""
242
222
if sample_rate == 0 :
243
223
self ._mode (_PICTURE_MODE )
244
224
return
@@ -257,8 +237,7 @@ def audio_play(self, sample_rate, audio_gain=0, agc_enable=False, agc_fast=False
257
237
self ._mode (_AUDIOPLAY_MODE )
258
238
259
239
def blink (self , rate = None ):
260
- """Updates the blink register
261
- """
240
+ """Updates the blink register"""
262
241
# pylint: disable=no-else-return
263
242
# This needs to be refactored when it can be tested
264
243
if rate is None :
@@ -300,8 +279,7 @@ def fill(self, color=None, blink=None, frame=None):
300
279
301
280
@staticmethod
302
281
def pixel_addr (x , y ):
303
- """Calulate the offset into the device array for x,y pixel
304
- """
282
+ """Calulate the offset into the device array for x,y pixel"""
305
283
return x + y * 16
306
284
307
285
# pylint: disable-msg=too-many-arguments
@@ -367,16 +345,14 @@ def image(self, img, blink=None, frame=None):
367
345
368
346
369
347
class CharlieWing (Matrix ):
370
- """Supports the Charlieplexed feather wing
371
- """
348
+ """Supports the Charlieplexed feather wing"""
372
349
373
350
width = 15
374
351
height = 7
375
352
376
353
@staticmethod
377
354
def pixel_addr (x , y ):
378
- """Calulate the offset into the device array for x,y pixel
379
- """
355
+ """Calulate the offset into the device array for x,y pixel"""
380
356
if x > 7 :
381
357
x = 15 - x
382
358
y += 8
0 commit comments