Page 1 of 1

Using Wiimote's accelerometter as input

Posted: Tue Aug 20, 2019 1:18 pm
by Pordrack
    Hi ! I had an idea of game where the wiimote would be used as Swords, I searched on the forum for Wiimotes library, but only found 7 years olds forums, and since love2d changes pretty fast... So , is there a way to use accelerometter as input ? Or to controle the light of the wiimote ? Or to output sound through the wiimote ?

    Re: Using Wiimote's accelerometter as input

    Posted: Thu Aug 22, 2019 2:08 pm
    by nameless tee
    If you want to use the WiiMote you're going to need an external library for that. You could use wiiuse (https://github.com/wiiuse/wiiuse) like this forum member (https://love2d.org/forums/viewtopic.php ... te#p164826) did.

    What they were doing is building a dynamically linked library/shared object that can be used with lua. It might be easier to skip that step and instead use luajits ffi to load the library directly. Here (http://luajit.org/ext_ffi_tutorial.html) is a tutorial that shows how to do that (the zlib example). The drawback of using a library is that you have to compile wiiuse for every platform you want to support and ship the library with your game.

    If you're really sure that all you need is the accelerometer (and not the gyroscope) and you want a lovelier solution you could ditch the Wiimote and use an android phone instead. On android love2d exposes the accelerometer as a joystick, so you could write an application that sends the accelerometer data to a PC using enet if the PC and the phone are on the same network.