For some reason my Joystick has an error

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
argaerfg 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);
}

Take a look at the library example code.

I picked one example and see this in there that you don't have:

// Create Joystick
Joystick_ Joystick;

Ok so I put that at the beginning (not in setup) and now it says the same error but with PinMode(A0, INPUT_PULLUP);

The Arduino programming language is case sensitive "PinMode" is not the same thing as "pinMode":

Thank you so much! For some reason I didn't notice that!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.