Way above my comprehension

Should have been straightforward, open verify upload boom done. But of course nothing is that simple for me. I did as instructed by the person who created the sketch but when I tried to upload it I got the error message

C:\Users\User\Desktop\Analog-E-Brake-master\ANALOG_EBRAKE\ANALOG_EBRAKE.ino: In function 'void setup()':

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

Joystick.begin();}

^

C:\Users\User\Desktop\Analog-E-Brake-master\ANALOG_EBRAKE\ANALOG_EBRAKE.ino: In function 'void loop()':

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

{Joystick.setThrottle(mapped);}}

^

exit status 1
'Joystick' was not declared in this scope

Any help would be greatly appreciated

Should have been straightforward, but you didn't provide us with anything to work on.

Maybe ask the person who created the sketch for you? Presumably, they've got the source code you seem so unwilling to share.

Start here

tell us also which Arduino you have...

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

just thought to myself how in the hell are they going to know what the problem is without the sketch...…

Choice:
just thought to myself how in the hell are they going to know what the problem is without the sketch...…

Now, think to yourself "How in Hell are they going to know which processor I have, and which processor I'm compiling for?"

using a Pro Mirco

the last line on the sketch is highlighted after trying to verify

have used a few other sketches from same provider and had no issue previously

I see this in the example code of the first joystick library I came across:

Joystick_ Joystick;

Probably worth adding it above your setup function.

That looks like this project. It comes with its own Joystick library and compiles just find for me (as long as I select the right board in Tools).

Are you using this particular Joystick library?

GypsumFantastic:
That looks like this project. It comes with its own Joystick library and compiles just find for me (as long as I select the right board in Tools).

Are you using this particular Joystick library?

Yes and yes
Like I said earlier have used a few of his sketches before and had no issue but this one giving me some grief.
The right board has been selected in tools.
Does it make a difference of it plugged into a USB board rather than directly into the PC??

wildbill:
I see this in the example code of the first joystick library I came across:

Joystick_ Joystick;

Probably worth adding it above your setup function.

And wildbill, you are the genius I was looking for!! Added the line and presto it works! Thank you thank you and thank you.

And thank you all that bothered to assist this twat in his moment of need. Muchly appreciated all

Choice:
And wildbill, you are the genius I was looking for!! Added the line and presto it works! Thank you thank you and thank you.

And thank you all that bothered to assist this twat in his moment of need. Muchly appreciated all

That's really odd. The line is in the library's cpp file. You shouldn't have to re-do it in the sketch.