Seitenkonsole

Seitenkonsole für Simulatoren (z. B. Farming Simulator)

Diese Seitenkonsole wurde ursprünglich für den Farming Simulator entworfen, ist jedoch universell für alle Simulatoren einsetzbar. Das Besondere an diesem Aufbau ist die Integration eines Streamdecks – dadurch wird eine besonders flexible und intuitive Steuerung ermöglicht.

Die Konsole bietet Platz für:

ein 15-Tasten-Streamdeck (z. B. von Soomfon – günstiger, aber funktional identisch zum Original),

eine zusätzliche 15-Tasten-Matrix,

und je nach Bedarf eine Blende für 1 oder 2 Joysticks.

Hinweis: Wer kein Streamdeck verwenden möchte, kann die passende Abdeckung stattdessen ein zweites Mal drucken – sie besitzt die gleichen Maße.

Je nach Konfiguration lassen sich damit bis zu 25 Tasten anschließen (mit zwei Joysticks), mit nur einem Joystick entsprechend mehr.

Alle Gehäuseteile werden mit M3-Schrauben verbunden. Die Schraublöcher sind für Einschmelzgewindeeinsätze (Messing) ausgelegt, was eine stabile und langlebige Montage gewährleistet.

Als Steuerplatine kommt ein Arduino Leonardo zum Einsatz. Dieser wird gewählt, weil er sich direkt als HID-Eingabegerät (z. B. Joystick oder Tastatur) am PC anmelden kann – ideal für Simulatoren!

SOFTWAREINSTALLATION

  1. ARDUINO IDE installieren: https://www.arduino.cc/en/software
  2. Benötigte Bibliotheken installieren:

    a) Joystick Library:
    https://github.com/MHeironimus/ArduinoJoystickLibrary

    b) Keypad Library:
    https://github.com/Chris--A/Keypad

    → Bibliotheken als ZIP herunterladen, dann:
    Arduino IDE → Sketch → Bibliothek einbinden → .ZIP-Bibliothek hinzufügen…

Sketch:

// Seitenkonsole mit 2x 3-Achs-Joysticks + 15-Tasten-Matrix für Arduino Leonardo
// Bibliotheken erforderlich: Joystick.h, Keypad.h

include

include

// Joystick-Konfiguration: 16 Buttons, 6 Achsen
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_JOYSTICK,
16, 0, // 16 Buttons, keine Hat-Switches
true, true, true, // X, Y, Z
true, true, true, // Rx, Ry, Rz
false, false, // Rudder, Throttle
false, false, false); // Accelerator, Brake, Steering

// Joystick 1: Pins und Button (X = A0, Y = A1)
const int joy1XPin = A0;
const int joy1YPin = A1;
const int joy1ZPin = A2;
const int joy1BtnPin = 12;

// Joystick 2: Pins und Button
const int joy2XPin = A3;
const int joy2YPin = A4;
const int joy2ZPin = A5;
const int joy2BtnPin = 13;

// Deadzone in +/- um Nullpunkt (auf -512 bis 512 gemappt)
const int DEADZONE = 20;

// Matrix (3 Zeilen, 5 Spalten)
const byte ROWS = 3;
const byte COLS = 5;
char keys[ROWS][COLS] = {
{ '1','2','3','4','5' },
{ '6','7','8','9','A' },
{ 'B','C','D','E','F' }
};

// Matrix-Pins auf Arduino Leonardo
byte rowPins[ROWS] = { 2, 3, 4 }; // Zeilen (D2–D4)
byte colPins[COLS] = { 5, 6, 7, 8, 9 }; // Spalten (D5–D9)

Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
bool buttonStates[16] = { false };

void setup() {
pinMode(joy1BtnPin, INPUT_PULLUP);
pinMode(joy2BtnPin, INPUT_PULLUP);
Joystick.begin();
Joystick.setXAxisRange(-512, 512);
Joystick.setYAxisRange(-512, 512);
Joystick.setZAxisRange(-512, 512);
Joystick.setRxAxisRange(-512, 512);
Joystick.setRyAxisRange(-512, 512);
Joystick.setRzAxisRange(-512, 512);
}

void loop() {
// Joystick 1
Joystick.setXAxis(processAxis(analogRead(joy1XPin)));
Joystick.setYAxis(processAxis(analogRead(joy1YPin)));
Joystick.setZAxis(processAxis(analogRead(joy1ZPin)));
Joystick.setButton(0, digitalRead(joy1BtnPin) == LOW);

// Joystick 2
Joystick.setRxAxis(processAxis(analogRead(joy2XPin)));
Joystick.setRyAxis(processAxis(analogRead(joy2YPin)));
Joystick.setRzAxis(processAxis(analogRead(joy2ZPin)));
Joystick.setButton(1, digitalRead(joy2BtnPin) == LOW);

// Matrix-Eingabe
char key = keypad.getKey();
if (key) {
int keyIndex = keyToIndex(key);
if (keyIndex >= 0 && keyIndex < 14) {
Joystick.setButton(keyIndex + 2, true);
buttonStates[keyIndex] = true;
}
}

// Rücksetzen nicht gedrückter Tasten
for (int i = 0; i < 14; i++) {
if (buttonStates[i] && !keypad.isPressed(keyFromIndex(i))) {
Joystick.setButton(i + 2, false);
buttonStates[i] = false;
}
}

delay(5);
}

int processAxis(int value) {
int centered = map(value, 0, 1023, -512, 512);
if (abs(centered) < DEADZONE) return 0;
return centered;
}

int keyToIndex(char key) {
if (key >= '1' && key <= '9') return key - '1';
if (key == 'A') return 9;
if (key == 'B') return 10;
if (key == 'C') return 11;
if (key == 'D') return 12;
if (key == 'E') return 13;
if (key == 'F') return 14;
return -1;
}

char keyFromIndex(int i) {
if (i >= 0 && i <= 8) return '1' + i;
if (i == 9) return 'A';
if (i == 10) return 'B';
if (i == 11) return 'C';
if (i == 12) return 'D';
if (i == 13) return 'E';
if (i == 14) return 'F';
return 0;
}

  1. In der Arduino IDE:
    Werkzeuge → Board: „Arduino Leonardo“ auswählen
    → Hochladen

https://amzn.eu/d/5BMJqdu das ist der Joystick 🕹️

Achtung : Z Achse sind die Kabel vertauscht . Rot ist plus ,weiß ist gnd, und schwarz geht zum Arduino.