Hello! I wanted to make my own steering wheel for games using Joystick library But for some reason my code pops up with this error
my code:
#include <Joystick.h>
#include <HID.h>
#include <Keyboard.h>
int button = 0;
int button1 = 0;
int delaytime = 0;
void setup() {
Joystick.begin();
Joystick.setXAxisRange(-127, 127);
PinMode(A0, INPUT_PULLUP);
Keyboard.begin();
pinMode(7, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
}
void loop() {
delaytime = 0;
button = digitalRead(7);
button1 = digitalRead(6);
if(button == 0)
Keyboard.print("r");
if(button == 0)
delaytime = 200;
if(button1 == 0)
Keyboard.print("f");
if(button1 == 0)
delaytime = 200;
byte pot1 = analogRead(A0);
Joystick.setXAxis(pot1);
delay(delaytime);
}