Using Wiimote's accelerometter as input

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Pordrack
Prole
Posts: 13
Joined: Tue Sep 04, 2018 5:23 pm

Using Wiimote's accelerometter as input

Post 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 ?
    nameless tee
    Prole
    Posts: 15
    Joined: Mon Apr 22, 2019 8:16 am

    Re: Using Wiimote's accelerometter as input

    Post 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.
    Post Reply

    Who is online

    Users browsing this forum: Ahrefs [Bot] and 74 guests