

In this code, the potentiometer has three "modes" left, straight and right will give a certain number depending on which mode it is. Then you start up the Arduino program and use this code to test your parts:Įdit: This code assumes your potentiometer can output values between 0-1023. Make sure that the components work by connecting the parts like in the picture. You'll need an Arduino (a Uno is sufficient!), two pressure-sensitive resistors, three 220kOhm resistors and a 10kOhm potentiometer.

At first we were worried that it would cause some issues with the input, but it worked anyways. That means the Arduino would for example have to send a value that says that one resistor is high, and after that send another value that says that the potentiometer is at its lowest, and so forth and then start over again. There is a serial connection between the Arduino and Unity, which means that the Arduino can only send one value at a time. The first thing we did was making sure a connection between the Arduino and Unity was possible. You need to have programming knowledge in C# (if you know other languages like Visual Basic, it's a fairly easy transition) if you want this to work smoothly. I made one game, established a connection between Unity and the Arduino and helped with the soldering, one friend made his own game and my other friend made the pedals and steering wheel. Unity was our software tool of choice to make our game in. Me and two friends had to make a project for school with the Arduino, and we thought that an interactive racing game with pedals and steering wheel sounded like a good idea.

So I've been reworking the text and added some more info! Edit: It's been two years since this project and article was made and looking back at it.
