2
\$\begingroup\$

I am making a car simulation game, however, I find it being inefficient and difficult to test the simulation realism and accuracy via keyboard or even joystick control. I need a steering wheel controller to do this. However, getting good steering wheel controllers is so difficult - they cost a lot. However, I noticed(when playing Real Racing 3) that the phone actually can handle such task kinda well.

What sort of code could I write to use a smart phone as a steering wheel?

Looking forward to see some useful answers ;)

\$\endgroup\$
0

1 Answer 1

2
\$\begingroup\$

Check out node-virtual-gamepads. It does almost what you want (doesn't seem to have accelerometer support yet). From its blurb:

This nodejs application provides the possibility to use your smarpthone as a gamepad controller on Linux OS simply by reaching a local address. You can virtually plug up to 4 gamepad controllers.

If for some reason you want to write your own, here's what you need:

  1. A phone app to detect phone inputs like the accelerometer. node-virtual-gamepads uses a web front end, you can also write a native app.
  2. A connection to your linux PC. node-virtual-gamepads uses web sockets, you can also use bluetooth.
  3. A program on your linux PC which can emulate a virtual gamepad via a kernel module. node-virtual-gamepads uses uinput with a node server.
\$\endgroup\$
2
  • \$\begingroup\$ OK! This looks like the start prequesites. I need to access the gyroscope. I guess I need some native code for that, but I don't want to bother with t&e so some papers about this would come in handy. For connection - how do you make a dynamic Bluetooth connection between mobile and laptop? In my case bluetooth would be better as I don't get a good network connection. And, lastly, what do you suggest for input gathering? All in all - thanks for input. \$\endgroup\$ Commented Mar 23, 2017 at 16:15
  • \$\begingroup\$ Questions are free here ;) \$\endgroup\$ Commented Mar 23, 2017 at 23:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .