Skip to content

#76 breaks status_neopixel using board.NEOPIXEL #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
VPTechOps opened this issue Feb 5, 2022 · 3 comments
Closed

#76 breaks status_neopixel using board.NEOPIXEL #77

VPTechOps opened this issue Feb 5, 2022 · 3 comments

Comments

@VPTechOps
Copy link
Contributor

VPTechOps commented Feb 5, 2022

The change for the neopixel power issue now prevents using board.NEOPIXEL for the network status_neopixel operand. I used the magtag library as magtag = Magtag(status_neopixel = board.NEOPIXEL). This will reproduce the issue.

I found that the initialization of Magtag() now initializes Network() before Peripherals(). When the status_neopixel operand is processed, Network() generates a new neopixel object using board.NEOPIXEL as neopixel.NeoPixel(status_neopixel, 1, brightness=0.2). Then, when Magtag() later initializes Peripherals(), Peripherals() attempts to create its neopixel object, board.NEOPIXEL is now in use.

I verified by creating a work around that moves init of Peripherals() before Network() and passing the self.peripherals.neopixels object to the Network() init. I also changed Network() to accept whatever status_NEOPIXEL parameter object that gets received and just uses that one instead of creating a new object. This works as intended.

@FoamyGuy
Copy link
Contributor

FoamyGuy commented Feb 5, 2022

@VPTechOps Thank you for reporting, want to make a PR with those changes?

@VPTechOps
Copy link
Contributor Author

I will do that. I need to update the code in network.py to allow anyone using a pin other than board.NEOPIXEL to still use the status_neopixel parameter with their pin. Will work on it later today.

@makermelissa
Copy link
Collaborator

Fixed via #78.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants