Joystick.h librairy and code from CIRCUITO.IO

Hello, I try use this code from CIRCUITO.IO but first i have a error "'Joystick' does not name a type" , i make the this correction "Joystick_ joystick(JOYSTICK_PIN_VRX,JOYSTICK_PIN_VRY,JOYSTICK_PIN_SW); "

and after i have a error "''class Joystick_' has no member named 'getX' " but i can't fin the solution!

Can you help!

// Include Libraries
#include "Arduino.h"
#include "Joystick.h"


// Pin Definitions
#define JOYSTICK_PIN_VRX    A1
#define JOYSTICK_PIN_VRY    A0
#define JOYSTICK_PIN_SW 2



// Global variables and defines

// object initialization
Joystick joystick(JOYSTICK_PIN_VRX,JOYSTICK_PIN_VRY,JOYSTICK_PIN_SW);



// define vars for testing menu
const int timeout = 10000;       //define timeout of 10 sec
char menuOption = 0;
long time0;

// Setup the essentials for your circuit to work. It runs first every time your circuit is powered with electricity.
void setup() 
{
    // Setup Serial which is useful for debugging
    // Use the Serial Monitor to view printed messages
    Serial.begin(9600);
    while (!Serial) ; // wait for serial port to connect. Needed for native USB
    Serial.println("start");
    
    
    menuOption = menu();
    
}

// Main logic of your circuit. It defines the interaction between the components you selected. After setup, it runs over and over again, in an eternal loop.
void loop() 
{
    
    
    if(menuOption == '1') {
    // PS2 X Y Axis Joystick Module - Test Code
    // Read Joystick X,Y axis and press
    int joystickX =  joystick.getX();
    int joystickY =  joystick.getY();
    int joystickSW =  joystick.getSW();
    Serial.print(F("X: ")); Serial.print(joystickX);
    Serial.print(F("\tY: ")); Serial.print(joystickY);
    Serial.print(F("\tSW: ")); Serial.println(joystickSW);

    }
    
    
    
    if (millis() - time0 > timeout)
    {
        menuOption = menu();
    }
    
}

Did you try:

joystick.get(X);

I try now but i have the same error

Please provide a link to where you got the Joystick library

https://www.circuito.io/app?components=513,11286,611984

after this link you go to "CODE" and you can download the code, library , and more

The Joystick library from that link has a getX() method

class Joystick 
{
	public:
		Joystick(int pinX, int pinY, int pinSW);
		//get X axis reading
		int getX();

The solution is here in french

https://forum.arduino.cc/index.php?topic=587863.0

you must copy all "firmware" in the "sketchbook"

tanks