cwiid
cwiid copied to clipboard
Duplicate table entries on output with wm.state with expanded rpt_mode
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.