Skip to content

Commit 0bf242c

Browse files
makermelissakattni
andauthored
Update adafruit_magtag/peripherals.py with example
Co-authored-by: Kattni <[email protected]>
1 parent e72ef10 commit 0bf242c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

adafruit_magtag/peripherals.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,15 @@ def light(self):
152152
"""
153153
Return the value of the light sensor. The neopixel_disable property
154154
must be false to get a value.
155+
.. code-block:: python
156+
157+
import time
158+
from adafruit_magtag.magtag import MagTag
159+
160+
magtag = MagTag()
161+
162+
while True:
163+
print(magtag.peripherals.light)
164+
time.sleep(0.01)
155165
"""
156166
return self._light.value

0 commit comments

Comments
 (0)