Hi all,
I finished 3d printing and building a sequential shifter found on thingyverse after receiving all the parts this weekend to complete it.
Shifter : https://www.thingiverse.com/thing:4557771/comments
Im a complete noob when it comes to arduinos. Ive opened the file that comes with the shifter and put the joystick.h file in the libraries folder. when i come to verify/compile the code it comes back with
Arduino: 1.8.13 (Windows 10), Board: "Arduino Leonardo"
C:\DIYSimShifter\DIYSimShifter.ino: In function 'void setup()':
DIYSimShifter:24:11: error: expected unqualified-id before '.' token
Joystick.begin();
^
C:\DIYSimShifter\DIYSimShifter.ino: In function 'void loop()':
DIYSimShifter:34:11: error: expected unqualified-id before '.' token
Joystick.setButton(0,!Up);
^
DIYSimShifter:35:11: error: expected unqualified-id before '.' token
Joystick.setButton(1,!Down);
^
exit status 1
expected unqualified-id before '.' token
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
The code included is :
//////////////////////////////////////////////////
// DIY Sim Shifter - For Arduino Leo/ProMicro //
// //
// By Brendan Beavis //
// v1.0 //
//////////////////////////////////////////////////
#include <Joystick.h>
//declare our digital input pins on the board
int upPin = 8;
int downPin = 5;
//this is the value of the input from the switches
int Up = 0;
int Down = 0;
void setup() {
//setup our pins
pinMode(upPin, INPUT_PULLUP);
pinMode(downPin, INPUT_PULLUP);
//setup the joystick library
Joystick.begin();
}
void loop( ){
//read our values from the switches to the digital input pins
Up = digitalRead(upPin);
Down = digitalRead(downPin);
//write the value of the input to the joystick buttons.
Joystick.setButton(0,!Up);
Joystick.setButton(1,!Down);
//wait a moment before rechecking the status of the inputs
delay(50);
}
Can anyone help with this please as ive no idea what im doing wrong.
Thanks
I finished 3d printing and building a sequential shifter found on thingyverse after receiving all the parts this weekend to complete it.
Shifter : https://www.thingiverse.com/thing:4557771/comments
Im a complete noob when it comes to arduinos. Ive opened the file that comes with the shifter and put the joystick.h file in the libraries folder. when i come to verify/compile the code it comes back with
Arduino: 1.8.13 (Windows 10), Board: "Arduino Leonardo"
C:\DIYSimShifter\DIYSimShifter.ino: In function 'void setup()':
DIYSimShifter:24:11: error: expected unqualified-id before '.' token
Joystick.begin();
^
C:\DIYSimShifter\DIYSimShifter.ino: In function 'void loop()':
DIYSimShifter:34:11: error: expected unqualified-id before '.' token
Joystick.setButton(0,!Up);
^
DIYSimShifter:35:11: error: expected unqualified-id before '.' token
Joystick.setButton(1,!Down);
^
exit status 1
expected unqualified-id before '.' token
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
The code included is :
//////////////////////////////////////////////////
// DIY Sim Shifter - For Arduino Leo/ProMicro //
// //
// By Brendan Beavis //
// v1.0 //
//////////////////////////////////////////////////
#include <Joystick.h>
//declare our digital input pins on the board
int upPin = 8;
int downPin = 5;
//this is the value of the input from the switches
int Up = 0;
int Down = 0;
void setup() {
//setup our pins
pinMode(upPin, INPUT_PULLUP);
pinMode(downPin, INPUT_PULLUP);
//setup the joystick library
Joystick.begin();
}
void loop( ){
//read our values from the switches to the digital input pins
Up = digitalRead(upPin);
Down = digitalRead(downPin);
//write the value of the input to the joystick buttons.
Joystick.setButton(0,!Up);
Joystick.setButton(1,!Down);
//wait a moment before rechecking the status of the inputs
delay(50);
}
Can anyone help with this please as ive no idea what im doing wrong.
Thanks