Merge pull request #56 from FoamyGuy/rename_mag_tag

rename mag_tag to magtag. Fix neopixel power pin handling
This commit is contained in:
foamyguy 2021-12-14 17:24:25 -06:00 committed by GitHub
commit e5e74f6b91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 10 deletions

View file

@ -21,4 +21,4 @@ elif "PyPortal" in os.uname().machine:
elif "Circuit Playground Bluefruit" in os.uname().machine:
from .cpb_gizmo import cpb_gizmo as pybadger
elif "MagTag with ESP32S2" in os.uname().machine:
from .mag_tag import mag_tag as pybadger
from .magtag import magtag as pybadger

View file

@ -3,7 +3,7 @@
# SPDX-License-Identifier: MIT
"""
`adafruit_pybadger.mag_tag`
`adafruit_pybadger.magtag`
================================================================================
Badge-focused CircuitPython helper library for Mag Tag.
@ -80,5 +80,5 @@ class MagTag(PyBadgerBase):
button = _unsupported
mag_tag = MagTag() # pylint: disable=invalid-name
magtag = MagTag() # pylint: disable=invalid-name
"""Object that is automatically created on import."""

View file

@ -10,7 +10,7 @@
.. automodule:: adafruit_pybadger.clue
:members:
.. automodule:: adafruit_pybadger.mag_tag
.. automodule:: adafruit_pybadger.magtag
:members:
.. automodule:: adafruit_pybadger.pewpewm4

View file

@ -52,9 +52,6 @@ try_refresh()
print("after show, going to loop")
neopixel_pwr = digitalio.DigitalInOut(board.NEOPIXEL_POWER)
neopixel_pwr.direction = digitalio.Direction.OUTPUT
neopixel_pwr.value = False
pybadger.pixels.fill(0x000022)
while True:
@ -65,7 +62,6 @@ while True:
if prev_a and not cur_a:
pybadger.pixels.fill(0x000000)
neopixel_pwr.value = True
if SHOWING != "badge":
print("changing to badge")
SHOWING = "badge"
@ -76,7 +72,6 @@ while True:
if prev_b and not cur_b:
pybadger.pixels.fill(0x000000)
neopixel_pwr.value = True
if SHOWING != "qr":
print("changing to qr")
SHOWING = "qr"
@ -85,7 +80,6 @@ while True:
if prev_c and not cur_c:
pybadger.pixels.fill(0x000000)
neopixel_pwr.value = True
if SHOWING != "card":
print("changing to card")
SHOWING = "card"