I am trying to add a simple boolean variable that I can change from multiple files. Atleast be able to change from marlin_main.cpp. I read I have to declare on a header file then define on one other file that includes the header and I should be able to use it.
I added
It compiles fine but when I try to use it like this
Thank you in advance.
I added
static bool endstopDisabled;to the header file then declared it in its .cpp file
bool endstopDisabled;
It compiles fine but when I try to use it like this
endstopDisabled = false;below in the same .cpp file it doesn't compile. It gives me the error "Error compiling for board Sanguino.". Anyone know what I am doing wrong? all I need is a boolean variable accessible to 2 files. Marlin_main.cpp and endstops.cpp. I am declaring variable in endstops.h.
Thank you in advance.