'Joystick' was not declared in this scope ERROR

Hi guys,

Here a total noob with a problem.
I have been searching the internet for a solution but no success so i hope you can help me.
I have a simple sketch from AMstudio but keep on getting a error when veriefying.
The joystick library is installed and i have the latest version IDE. (Arduino ATmega32U4 Board micro)
Sketch:

#include <Joystick.h>

void setup()

{pinMode(A0, INPUT);
Joystick.begin();}

const int pinToButtonMap = A0;

void loop()

{int pot = analogRead(A0);
int mapped = map(pot,0,1023,0,255);
{Joystick.setThrottle(mapped);}}

And i get the following error:

C:\Users\Theo\Desktop\ANALOG_EBRAKE\ANALOG_EBRAKE.ino: In function 'void setup()':

ANALOG_EBRAKE:13: error: 'Joystick' was not declared in this scope

Joystick.begin();}

^

C:\Users\Theo\Desktop\ANALOG_EBRAKE\ANALOG_EBRAKE.ino: In function 'void loop()':

ANALOG_EBRAKE:21: error: 'Joystick' was not declared in this scope

{Joystick.setThrottle(mapped);}}

^

Meerdere bibliotheken gevonden voor "Joystick.h"
Gebruikt: C:\Users\Theo\Documents\Arduino\libraries\Joystick
Niet gebruikt: C:\Program Files (x86)\Arduino\libraries\Joystick
exit status 1
'Joystick' was not declared in this scope

Hope you can help me, THANKS

The below code is just a bit of a guess as I don't know which library you're using. You probably need a line like

JOYSTICK Joystick;

Look at the examples that come with the library. Please post a link to the library if you need further help; it does not seem to be a standard Arduino one.