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

Nbr Motion Plus msgs != Nbr Accelerometer msgs #14

Open
Franck7L opened this issue May 20, 2017 · 0 comments
Open

Nbr Motion Plus msgs != Nbr Accelerometer msgs #14

Franck7L opened this issue May 20, 2017 · 0 comments

Comments

@Franck7L
Copy link

Hi,

I'm trying to use several wiimotes on Rpi3 and I can do a lot of things with xwiimote. Thanks !

Prevously I've used Cwiid which always gives the same amount of MP and ACCEL messages.
I'm now going into xwiimote because I have RVL-CNT-01-TR wiimotes.

But by using the polling system as in our python binding example, i'm always getting more MotionPlus messages than Accelerometer messages.

Below is a reducted code i've made to demonstrate the issue.
IThere's a dynamic layer (because nbr of wiimote is not always the same) but I've isolated the first wiimote to count the messages :

p = poll() 
evt = xwiimote.event()
for interface in interfaces :     
    p.register(interface.get_fd(), POLLIN)

MP_event = 0
AC_event = 0

while transmission :    
    p.poll()
    wm = 0           
    for interface in interfaces :        
        try:
            interface.dispatch(evt)
            if wm == 0 :            
                if evt.type == xwiimote.EVENT_MOTION_PLUS:                                  
                    MP_event +=1
                elif evt.type == xwiimote.EVENT_ACCEL:                
                    AC_event +=1
        except IOError as e:
            if e.errno != errno.EAGAIN:
                print "Bad" 
        wm +=1
        print MP_event, AC_event

MP_event is always growing faster than AC_event.
Any idea on the reason and something I can do to recover the same amounts ?

Best regards,

Franck

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