Skip to content
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

Duplicate table entries on output with wm.state with expanded rpt_mode #40

Open
knoxvillesjoker opened this issue Aug 9, 2020 · 0 comments

Comments

@knoxvillesjoker
Copy link

Setting wiimote with this:
import cwiid
wm=cwiid.wiimote()
wm.rpt_mode = cwiid.RPT_BTN | cwiid.RPT_ACC | cwiid.RPT_NUNCHUK

then running wm.state
yields:
{'rpt_mode' : 22, 'led' : 2, 'rumble' : 0, 'battery': 120, 'ext_type': 1, 'error': 0, 'buttons': 0, 'acc': (145, 128, 145), 'nunchuk': {'stick': (125, 129), 'acc': (171, 117, 132), 'buttons': 0}}

The problem is that there are two readings for:
acc, and buttons in the array. This creates errors with dictionaries in python as when you try to pull one of those duplicate keys out it errors out.

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

1 participant