While I'm at it:
I found parts of this poster to be a really handy reference. It's too detailed for a single sheet of A4 so I used rasterbator to break it into several and print it at home. I've since realised I don't use all of it, and physically cut it down to a convenient shape and size for my workbench.
This
is the best tip I've found in this thread so far, and it's come to me just as I needed it. Amazing. Thank you! One question about this bit:
Hint
We usually place our Global variables in the area just above the setup() function.
If you place these variables between braces, { }, you can then code fold this area at the opening { bace + and - button.
This works for me, in that the code becomes collapsable... but then I get an error when I try to compile:
exit status 1
expected unqualified-id before '{' token
Can you see what I'm doing wrong please?
LarryD
January 25, 2022, 5:58pm
2
Humm, I could swear this worked at one time.
Better still, use tabs in the IDE to organize your code.
Here, all the global variables have been cut from our sketch and pasted into a new Tab in our sketch (Header.h).
Once they are in the the new Tab , a #include statement is added back in our .ino sketch tab at the top of the code:
#include "Header.h"
Add other Tabs as needed.
What this allows you to do is access your Global variables etc. from anywhere in your main sketch by simply clicking on the Header.h Tab whenever needed.
samshltn:
This works for me, in that the code becomes collapsable... but then I get an error when I try to compile:
exit status 1
expected unqualified-id before '{' token
Can you see what I'm doing wrong please?
Can I suggest you open a new thread in Programming to get an answer.
Also post your code in code tags.
To add code please click this link;
See also FAQ - Arduino Forum for general rules on forum behavior and etiquette.
Hello,
Welcome to the Arduino Forum.
This guide explains how to get the best out of this forum. Please read and follow the instructions below.
Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is frus…
Tom...
A curly bracket "}" is not going to be effective if it is in a comment.