Skip to content

Commit e5e74f6

Browse files
authored
Merge pull request #56 from FoamyGuy/rename_mag_tag
rename mag_tag to magtag. Fix neopixel power pin handling
2 parents dad4acf + 86c4141 commit e5e74f6

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

adafruit_pybadger/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
elif "Circuit Playground Bluefruit" in os.uname().machine:
2222
from .cpb_gizmo import cpb_gizmo as pybadger
2323
elif "MagTag with ESP32S2" in os.uname().machine:
24-
from .mag_tag import mag_tag as pybadger
24+
from .magtag import magtag as pybadger

adafruit_pybadger/mag_tag.py renamed to adafruit_pybadger/magtag.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: MIT
44

55
"""
6-
`adafruit_pybadger.mag_tag`
6+
`adafruit_pybadger.magtag`
77
================================================================================
88
99
Badge-focused CircuitPython helper library for Mag Tag.
@@ -80,5 +80,5 @@ def _unsupported(self):
8080
button = _unsupported
8181

8282

83-
mag_tag = MagTag() # pylint: disable=invalid-name
83+
magtag = MagTag() # pylint: disable=invalid-name
8484
"""Object that is automatically created on import."""

docs/api.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
.. automodule:: adafruit_pybadger.clue
1111
:members:
1212

13-
.. automodule:: adafruit_pybadger.mag_tag
13+
.. automodule:: adafruit_pybadger.magtag
1414
:members:
1515

1616
.. automodule:: adafruit_pybadger.pewpewm4

examples/pybadger_magtag_simpletest.py

-6
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ def try_refresh():
5252

5353
print("after show, going to loop")
5454

55-
neopixel_pwr = digitalio.DigitalInOut(board.NEOPIXEL_POWER)
56-
neopixel_pwr.direction = digitalio.Direction.OUTPUT
57-
neopixel_pwr.value = False
5855
pybadger.pixels.fill(0x000022)
5956

6057
while True:
@@ -65,7 +62,6 @@ def try_refresh():
6562

6663
if prev_a and not cur_a:
6764
pybadger.pixels.fill(0x000000)
68-
neopixel_pwr.value = True
6965
if SHOWING != "badge":
7066
print("changing to badge")
7167
SHOWING = "badge"
@@ -76,7 +72,6 @@ def try_refresh():
7672

7773
if prev_b and not cur_b:
7874
pybadger.pixels.fill(0x000000)
79-
neopixel_pwr.value = True
8075
if SHOWING != "qr":
8176
print("changing to qr")
8277
SHOWING = "qr"
@@ -85,7 +80,6 @@ def try_refresh():
8580

8681
if prev_c and not cur_c:
8782
pybadger.pixels.fill(0x000000)
88-
neopixel_pwr.value = True
8983
if SHOWING != "card":
9084
print("changing to card")
9185
SHOWING = "card"

0 commit comments

Comments
 (0)