Help me with the code

These images show my code, I defined the variable in preauton then in auton, it did not detect it.

this is the second image that is needed

I was “new” before I posted the post.

you defined varAUTO in a function, not in your autonomous, so you made a temporary variable and not a global variable

ok, so what do I do? it is in my pre auton. how do Imake it a global variable in pre auton

in whatever function you run first

not sure what you mean by

Deicer said:
In whatever function you run first

I can’t read your whole code but you have to define your variables in the function you plan to use them in. Since the error I see is in task autonomous, you have to define it there or call a global variable.

how do I make a global variable?
This should be a general rundown of everything you need about declaring variables