20
20
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
# THE SOFTWARE.
22
22
"""
23
- `Adafruit_TLC59711 `
23
+ `adafruit_tlc59711 `
24
24
====================================================
25
25
26
26
CircuitPython module for the TLC59711 16-bit 12 channel LED PWM driver. See
@@ -69,17 +69,12 @@ class TLC59711:
69
69
independent channel by name (r0, g0, b0, r1, b1, etc.) as properties for
70
70
fine-grained control.
71
71
72
- Specify the following parameters to initialize:
73
- - spi: An instance of the SPI bus connected to the chip. The clock and
74
- MOSI/outout must be set, the MISO/input is unused.
75
-
76
- You can also specify the following optional parameters:
77
- - auto_show: This is a boolean that defaults to True and indicates any
78
- change to a channel value will instantly be written to the
79
- chip. You might wish to set this to false if you desire to
80
- perform your own atomic operations of channel values. In that
81
- case call the show function after making updates to channel
82
- state.
72
+ :param ~busio.SPI spi: An instance of the SPI bus connected to the chip. The clock and
73
+ MOSI/outout must be set, the MISO/input is unused.
74
+ :param bool auto_show: This is a boolean that defaults to True and indicates any
75
+ change to a channel value will instantly be written to the chip. You might wish to
76
+ set this to false if you desire to perform your own atomic operations of channel
77
+ values. In that case call the show function after making updates to channel state.
83
78
"""
84
79
85
80
class _GS_Value :
@@ -202,16 +197,16 @@ def _write(self):
202
197
self ._spi .unlock ()
203
198
204
199
def show (self ):
205
- """Write out the current LED PWM state to the chip. This is only
206
- necessary if auto_show was set to false in the initializer.
200
+ """Write out the current LED PWM state to the chip. This is only necessary if
201
+ auto_show was set to false in the initializer.
207
202
"""
208
203
self ._write ()
209
204
210
205
# Define properties for global brightness control channels.
211
206
@property
212
207
def red_brightness (self ):
213
- """Get and set the red brightness for all channels (i.e. R0, R1, R2,
214
- and R3). This is a 7-bit value from 0-127.
208
+ """The red brightness for all channels (i.e. R0, R1, R2, and R3). This is a 7-bit
209
+ value from 0-127.
215
210
"""
216
211
return self ._bcr
217
212
@@ -224,8 +219,8 @@ def red_brightness(self, val):
224
219
225
220
@property
226
221
def green_brightness (self ):
227
- """Get and set the green brightness for all channels (i.e. G0, G1,
228
- G2, and G3). This is a 7-bit value from 0-127.
222
+ """The green brightness for all channels (i.e. G0, G1, G2, and G3). This is a
223
+ 7-bit value from 0-127.
229
224
"""
230
225
return self ._bcg
231
226
@@ -238,8 +233,8 @@ def green_brightness(self, val):
238
233
239
234
@property
240
235
def blue_brightness (self ):
241
- """Get and set the blue brightness for all channels (i.e. B0, B1,
242
- B2, and B3). This is a 7-bit value from 0-127.
236
+ """The blue brightness for all channels (i.e. B0, B1, B2, and B3). This is a 7-bit
237
+ value from 0-127.
243
238
"""
244
239
return self ._bcb
245
240
@@ -258,7 +253,7 @@ def __len__(self):
258
253
259
254
def __getitem__ (self , key ):
260
255
"""Retrieve the R, G, B values for the provided channel as a
261
- 3-tuple. Each value is a 16-bit number from 0-65535.
256
+ 3-tuple. Each value is a 16-bit number from 0-65535.
262
257
"""
263
258
if key == 0 :
264
259
return (self .r0 , self .g0 , self .b0 )
@@ -273,7 +268,7 @@ def __getitem__(self, key):
273
268
274
269
def __setitem__ (self , key , val ):
275
270
"""Set the R, G, B values for the provided channel. Specify a
276
- 3-tuple of R, G, B values that are each 16-bit numbers (0-65535).
271
+ 3-tuple of R, G, B values that are each 16-bit numbers (0-65535).
277
272
"""
278
273
assert 0 <= key <= 3 # Do this check here instead of later to
279
274
# prevent accidentally keeping auto_show
0 commit comments