Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Initial PR of PyBadger. #1

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

Merged
merged 5 commits into from
Jun 27, 2019
Merged

Initial PR of PyBadger. #1

merged 5 commits into from
Jun 27, 2019

Conversation

kattni
Copy link
Contributor

@kattni kattni commented Jun 27, 2019

Still a WIP, but passes Pylint and Sphinx builds. Needs more documentation and better example code. PR'd for @ladyada's use.

@kattni kattni requested a review from ladyada June 27, 2019 02:39
@ladyada ladyada merged commit 381f826 into adafruit:master Jun 27, 2019
return Buttons(*[button_values & button for button in
(PyBadger.BUTTON_B, PyBadger.BUTTON_A, PyBadger.BUTTON_START,
PyBadger.BUTTON_SELECT, PyBadger.BUTTON_RIGHT,
PyBadger.BUTTON_DOWN, PyBadger.BUTTON_UP, PyBadger.BUTTON_LEFT)])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this handle the joystick as a directional on pygamer as well?

Why have one property for all buttons instead of 8 separate ones to match circuitplayground?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to make it handle the joystick. There's a separate property for the joystick.

I initially had it in separate properties, however calling get_pressed multiple times clears the previous button press. This seemed more efficient and allows for multiple button presses to be maintained.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the multiple press tracking isn't needed for this simple library. Your example code calls get_pressed multiple times anyway.

I imagine having the joystick count as a directional button would be more beneficial because the client code will work on PyGamer and PyBadge without modification.

makermelissa pushed a commit that referenced this pull request Feb 20, 2020
merge badge changes into clue adaptation
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

Successfully merging this pull request may close these issues.

3 participants