//included libaries
#include <Joystick.h>
//define input pins
#define SPLIT 1
#define RANGE 2
#define ENG_BRAKE 3
//joystick(joystick HID ID, Justick type, Button count, Hat switch count, Include X, Include Y, Include Z
//include Rx, Include Ry, include Rz, Include Throttle, Include Accelorator, Include Break, Include Steering
Joystick_ Joystick(0X3, JOYSTICK_TYPE_JOYSTICK, 3, 0, false, false, true, false, false, false, false, true, false, false, false);
const bool initAutoSendState = true;
int lastButtonSPLITState = 0;
int lastButtonRANGEState = 0;
int lastButtonENG_BRAKEState = 0;
void setup() {
// put your setup code here, to run once:
pinMode(SPLIT, INPUT_PULLUP);
pinMode(RANGE, INPUT_PULLUP);
pinMode(ENG_BRAKE, INPUT_PULLUP);
Joystick.begin();
}
void loop() {
int currentButtonSPLITState = !digitalRead(SPLIT);
if (currentButtonSPLITState != lastButtonSPLITState) {
Joystick.setButton (6, currentButtonSPLITState);
lastButtonSPLITState = currentButtonSPLITState;
}
int currentButtonRANGEState = !digitalRead(RANGE);
if (currentButtonRANGEState != lastButtonRANGEState) {
Joystick.setButton (7, currentButtonRANGEState);
lastButtonRANGEState = currentButtonRANGEState;
}
int currentButtonENG_BRAKEState = !digitalRead(ENG_BRAKE);
if (currentButtonENG_BRAKEState != lastButtonENG_BRAKEState) {
Joystick.setButton (8, currentButtonENG_BRAKEState);
lastButtonENG_BRAKEState = currentButtonENG_BRAKEState;
}
//pole delay/debounce
delay(10);
}
In file included from C:\Users\morga\OneDrive\Documents\Arduino\Shifter_and_pedals\Shifter_and_pedals.ino:2:0:
C:\Users\morga\OneDrive\Documents\Arduino\libraries\ArduinoJoystickLibrary-version-2.0\src/Joystick.h:24:10: fatal error: DynamicHID/DynamicHID.h: No such file or directory
#include "DynamicHID/DynamicHID.h"
^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: exit status 1
I am not sure what I did wrong with this as I have changed nothing in the code since the last time that I used it.