@@ -73,6 +73,7 @@ def acceleration(self):
73
73
"""Obtain data from the x, y and z axes.
74
74
75
75
.. image :: /_static/accelerometer.jpg
76
+ :alt: Accelerometer
76
77
77
78
This example prints the values. Try moving the board to see how the
78
79
printed values change.
@@ -92,6 +93,7 @@ def touch_A1(self):
92
93
"""Detect touch on capacitive touch pad A1.
93
94
94
95
.. image :: /_static/capacitive_touch_pad_A1.jpg
96
+ :alt: Capacitive touch pad A1
95
97
96
98
.. code-block:: python
97
99
@@ -110,6 +112,7 @@ def touch_A2(self):
110
112
"""Detect touch on capacitive touch pad A2.
111
113
112
114
.. image :: /_static/capacitive_touch_pad_A2.jpg
115
+ :alt: Capacitive touch pad A2
113
116
114
117
.. code-block:: python
115
118
@@ -128,6 +131,7 @@ def touch_A3(self):
128
131
"""Detect touch on capacitive touch pad A3.
129
132
130
133
.. image :: /_static/capacitive_touch_pad_A3.jpg
134
+ :alt: Capacitive touch pad A3
131
135
132
136
.. code-block:: python
133
137
@@ -146,6 +150,7 @@ def touch_A4(self):
146
150
"""Detect touch on capacitive touch pad A4.
147
151
148
152
.. image :: /_static/capacitive_touch_pad_A4.jpg
153
+ :alt: Capacitive touch pad A4
149
154
150
155
.. code-block:: python
151
156
@@ -164,6 +169,7 @@ def touch_A5(self):
164
169
"""Detect touch on capacitive touch pad A5.
165
170
166
171
.. image :: /_static/capacitive_touch_pad_A5.jpg
172
+ :alt: Capacitive touch pad A5
167
173
168
174
.. code-block:: python
169
175
@@ -182,6 +188,7 @@ def touch_A6(self):
182
188
"""Detect touch on capacitive touch pad A6.
183
189
184
190
.. image :: /_static/capacitive_touch_pad_A6.jpg
191
+ :alt: Capacitive touch pad A6
185
192
186
193
.. code-block:: python
187
194
@@ -200,6 +207,7 @@ def touch_A7(self):
200
207
"""Detect touch on capacitive touch pad A7.
201
208
202
209
.. image :: /_static/capacitive_touch_pad_A7.jpg
210
+ :alt: Capacitive touch pad A7
203
211
204
212
.. code-block:: python
205
213
@@ -219,20 +227,23 @@ def pixels(self):
219
227
of the CircuitPlayground. Each pixel is at a certain index in the sequence
220
228
as labeled below. Colors can be RGB hex like 0x110000 for red where each
221
229
two digits are a color (0xRRGGBB) or a tuple like (17, 0, 0) where (R, G, B).
230
+ Set the global brightness using any number from 0 to 1 to represent a
231
+ percentage, i.e. 0.3 sets global brightness to 30%.
222
232
223
233
See `neopixel.NeoPixel` for more info.
224
234
225
235
.. image :: /_static/neopixel_numbering.jpg
226
- :alt: NeoPixel order diagram
236
+ :alt: NeoPixel order diagram
227
237
228
238
Here is an example that sets the first pixel green and the second red.
229
239
230
240
.. code-block:: python
231
241
232
242
from adafruit_circuitplayground.express import cpx
233
243
234
- cpx.pixels[0] = 0x000300
235
- cpx.pixels[9] = 0x030000
244
+ cpx.pixels.brightness = 0.3
245
+ cpx.pixels[0] = 0x003000
246
+ cpx.pixels[9] = (30, 0, 0)
236
247
237
248
# Wait forever. CTRL-C to quit.
238
249
while True:
@@ -245,7 +256,7 @@ def button_a(self):
245
256
"""``True`` when Button A is pressed. ``False`` if not.
246
257
247
258
.. image :: /_static/button_a.jpg
248
- :alt: NeoPixel order diagram
259
+ :alt: Button A
249
260
250
261
.. code-block:: python
251
262
@@ -262,7 +273,7 @@ def button_b(self):
262
273
"""``True`` when Button B is pressed. ``False`` if not.
263
274
264
275
.. image :: /_static/button_b.jpg
265
- :alt: NeoPixel order diagram
276
+ :alt: Button B
266
277
267
278
.. code-block:: python
268
279
@@ -281,7 +292,7 @@ def switch(self):
281
292
``False`` when it is to the right towards the ear.
282
293
283
294
.. image :: ../_static/slide_switch.jpg
284
- :alt: NeoPixel order diagram
295
+ :alt: Slide switch
285
296
286
297
.. code-block:: python
287
298
@@ -299,7 +310,7 @@ def temperature(self):
299
310
"""The temperature of the CircuitPlayground in Celsius.
300
311
301
312
.. image :: /_static/thermistor.jpg
302
- :alt: NeoPixel order diagram
313
+ :alt: Temperature sensor
303
314
304
315
Converting this to Farenheit is easy!
305
316
@@ -322,7 +333,7 @@ def light(self):
322
333
"""The brightness of the CircuitPlayground in approximate Lux.
323
334
324
335
.. image :: /_static/light_sensor.jpg
325
- :alt: NeoPixel order diagram
336
+ :alt: Light sensor
326
337
327
338
Try covering the sensor next to the eye to see it change.
328
339
@@ -342,7 +353,7 @@ def red_led(self):
342
353
"""The red led next to the USB plug marked D13.
343
354
344
355
.. image :: /_static/red_led.jpg
345
- :alt: NeoPixel order diagram
356
+ :alt: D13 LED
346
357
347
358
.. code-block:: python
348
359
@@ -383,6 +394,7 @@ def play_tone(self, frequency, duration):
383
394
:param float duration: The duration of the tone in seconds
384
395
385
396
.. image :: /_static/speaker.jpg
397
+ :alt: Onboard speaker
386
398
387
399
.. code-block:: python
388
400
@@ -402,6 +414,7 @@ def start_tone(self, frequency):
402
414
:param int frequency: The frequency of the tone in Hz
403
415
404
416
.. image :: /_static/speaker.jpg
417
+ :alt: Onboard speaker
405
418
406
419
.. code-block:: python
407
420
@@ -426,6 +439,7 @@ def stop_tone(self):
426
439
""" Use with start_tone to stop the tone produced.
427
440
428
441
.. image :: /_static/speaker.jpg
442
+ :alt: Onboard speaker
429
443
430
444
.. code-block:: python
431
445
@@ -450,6 +464,7 @@ def play_file(self, file_name):
450
464
:param file_name: The name of your .wav file in quotation marks including .wav
451
465
452
466
.. image :: /_static/speaker.jpg
467
+ :alt: Onboard speaker
453
468
454
469
.. code-block:: python
455
470
0 commit comments