Joystick box done!

10275952_10202647235476806_8669147863797216083_n

The box for the joystick is finally cut and held together by acetone. We collected the assemblies by holding them together with a hairelastic and injected the acetone on the sides and the corners of the box. In that way we avoided that the whole box got acetone all over it.

We have optimized the size to the minimal and thereof also the amount of material.

The box is rectangular and has air holes on the two long sides. This is to make sure that the  mechanics wont get overheated. Furthermore there are holes for the cables, the screen and the joystick itself. Our groupname and groupnumber are printed on the lower side of the box. This is a nice detail, which gives our box an individual touch without disrupting the userfriendliness.

Arduino Pro Micro caused us a lot of problems and therefor we decided not to go any further with it. Instead, we changed it to an ordinary Arduino board. Before we knew if we were going to use the micro Arduino, we made holes for screws to hold up the three AAA batteries  in one of the boxes (this is also shown on the picture above). When we realised we weren’t going to use the AAA-batteries after all, we removed the batteryholder and therefore there are two screwholes on one side of the box.

 

The joystick – a simple overview

In order to create an overview of how the joystick will work, we have created a simple drawing, which illustrates the proces.

Skærmbillede 2014-04-23 kl. 16.50.55

The question is being send from Arduino 1 to Arduino 2, which the joystick is connected to. The options are listed on the screen, and the joystick is being flipped according to the answer in one of the four directions in X-Y-coordinates.  If ,for an example, A is chosen for an answer, the joystick is flipped 45 degrees upward and the answer is being saved on the Arduino 2.

Arduino 2 then sends the answer back to Arduino 1, where the answer is being registred.

 

The joystick

The joystick is composed of two potentiometers, which acts a a voltage divider when supplied with 5V. To read the tilt to either X or Y direction, the arduino can read and analog value to determine how far the stick has been tilted. When in the middle, the read input is around 508-519 because of noise in the reading. To determine if the user has been tilted, is when the voltage reads higer than 530 or lower than 450 to compensate for noise.The program reads the two values which is put into Analog 1 and 0. If statements determines which carachters that is set to either A, B, C, D. This is sent to the serial window to debug the behavoiur of the joystick. The code reads X values in first, and then Y, since the sticks needs to move more than 45 degress in another direction for the code to choose another character to send. The code can be put directly into the program to work with the rest of the code to determine which input the user has choosen in the quiz.

Skærmbillede 2014-04-16 kl. 17.18.00