i have this code and i keep getting this error message
expected unqualified-id before ' ' token
this is my code
#include <Joystick.h>
const int potPin = A0;
void setup() {
Joystick.begin();
pinMode(potPin, INPUT);
}
void loop() {
int potValue = analogRead(potPin);
int joystickValue = map(potValue, 0, 1023, -32767, 32767);
Joystick.setXAxis(joystickValue);
delay(10);
}
The line
Joystick.setXAxis(joystickValue);
seems to be calling up a method that is not in the library.
Where did you get the idea that this method exists?
oh sorry i was looking at 2 library's and i must of merged them together, and no i dont know what the other one was
although it states i can use Joystick.setXAxis(joystickValue);
in here so?
What type of variable does the function take and what type of variable are you passing to it ?
From the examples:
// Create Joystick
Joystick_ Joystick;
I don't see that in your code.
So that is not the library that you get when you load it in through then Arduino IDE. It was very remiss of you not to mention that. That Github page is a new version that the writer has not bothered to update on the forum software.
You must have not of.
Wow super helpful.
system
Closed
November 7, 2023, 4:51pm
9
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.