Home
About
Blog
Media Gallery

DJ Truck Shifter


The code for my split and range buttons on my custom Eaton Fuller S-2588 Roadranger valve assy RTLO 18 speed genuine shifter. Switches were connected to hall sensors and an Arduino Micro board.

MHeironimus/ArduinoJoystickLibrary
Media Gallery

Arduino IDE
#include <Joystick.h>

int AntallKnapper = 2;

Joystick_ Joystick(
  0x03,   // hidReportId
  0x04,   // joystickType
  AntallKnapper,     // buttonCount
  0,      // hatSwitchCount
  false,  // includeXAxis
  false,  // includeYAxis 
  false,  // includeZAxis
  false,  // includeRxAxis
  false,  // includeRyAxis
  false,  // includeRzAxis
  false,  // includeRudder
  false,  // includeThrottle
  false,  // includeAccelerator
  false,  // includeBrake
  false   // includeSteering
);

void setup() {
  pinMode(2, INPUT_PULLUP);  
  pinMode(3, INPUT_PULLUP); 
  
  Joystick.begin();
}

void loop() {
  Joystick.setButton(0, digitalRead(2));
  Joystick.setButton(1, !digitalRead(3));
  
  delay(50);
}


Original Post: Feb 2nd, '22 13:59 CET.
Updated: Feb 2nd, '22 18:28 CET.

Tags: Arduino