Using Wiimote's accelerometter as input
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Using Wiimote's accelerometter as input
-
- Prole
- Posts: 15
- Joined: Mon Apr 22, 2019 8:16 am
Re: Using Wiimote's accelerometter as input
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.
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.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 8 guests