Small compact dual joystick for arnduino or any other platform you might use. It requires pull-up resistor on input pins. A way i got arround this was by using the Arduino INPUT_PULLUP feature.
The Code to run this board in Arduino.
/* ThumbBoardV1
Written by DanielFrausto
Use and modify as you wish.
Unless you are a Zombie.
*/
int h1 = A0;
int v1 = A1;
int v2 = A2;
int h2 = A3;
void setup() {
pinMode(v1, INPUT_PULLUP);
pinMode(h1, INPUT_PULLUP);
pinMode(v2, INPUT_PULLUP);
pinMode(h2, INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
int v01 = analogRead(v1);
int h01 = analogRead(h1);
int v02 = analogRead(v2);
int h02 = analogRead(h2);
delay(60);
Serial.print("V1 = ");
Serial.print(v01);
Serial.print(" ");
Serial.print("H1 = ");
Serial.print(h01);
Serial.print(" ");
Serial.print("V2 = ");
Serial.print(v02);
Serial.print(" ");
Serial.print("H2= ");
Serial.print(h02);
Serial.print(" ");
Serial.print('\n');
if (v01 < 120) {
Serial.print(" JS1 UP \n");
}
if (v01 > 150) {
Serial.print(" JS1 DOWN \n");
}
if (h01 < 120) {
Serial.print(" JS1 LEFT \n");
}
if (h01 > 180) {
Serial.print(" JS1 RIGHT \n");
}
if (v02 < 120) {
Serial.print(" JS2 UP \n");
}
if (v02 > 130) {
Serial.print(" JS2 DOWN \n");
}
if (h02 < 110) {
Serial.print(" JS2 LEFT \n");
}
if (h02 > 120) {
Serial.print(" JS2 RIGHT \n");
}
delay(60);
}