Assuming you hold the wiimote vertically like this:
you can start with:
Code: Select all
vJoy[0].x = filters.ensureMapRange((wiimote[0].acceleration.y-9.81), 12, -12, -16384, 16384)
9.81 is the assumed Earth's acceleration, but the actual vector depends on your geographical location (I think?), so for me it was about 8.5. Measure it by placing Wiimote on its side on a horizontal surface. Also, the range 12, -12 is what I found convenient for the 'wheel' movement - going up to 15 gives you a better range, but less convenient hold and the other way round. Finally, you should experiment with smoothing (filters.simple), as the readings are somewhat jerky.
Unfortunately, there is no other analog control on Wii, which makes acceleration and braking rather rough in racing sims. You could try to experiment with:
Code: Select all
vJoy[0].y = filters.ensureMapRange((wiimote[0].acceleration.z-9.81), 12, -12, -16384, 16384)
but I do not find it practical - you have to move the Wiimote in two planes at same time, which is somewhat tricky. Maybe with practice...