What do the syntax colors mean?

Hi,

I am new to programming. I am wondering where I can find an explanation of the syntax coloring used in the Arduino 1.0.5 IDE.

Also, Is there a way I can print out the Arduino commands? Are they available anywhere in a printable format? I would find it easier for me if I refer to a hard copy rather than using the on line Language Reference.

Thanks in advance,

bash11

2 Likes

Scroll down to the bottom where it talks about KEYWORDS.

1 Like

Thanks for your reply. I read the link mentioned in the reply. I did not see any reference to the color of the font except by just reading the sketch and noting the colors. I did not see any correlation I am new to programming so this may be obvious to more experienced programmers. What do the gold, blue, red, black, and grey color fonts represent? For example, are all functions one color, and all variables another, etc.?

I would still like to print out or buy a hard copy of the language reference. Anyone know where I can find a source?

Bash11

If it helps, I personally just ignore them. They are just "eye candy" as far as I am concerned. Often words get highlighted for the wrong reasons, and other words are not coloured, although they should be.

Having said that they probably have one colour for C operators (like "while", "for"), one for comments, and one for "well-known" functions (like Serial.print).

The colouring of comments is useful, I suppose, and colouring function names help you see if you have misspelt them, but as I said, don't get too excited. :slight_smile:

1 Like

Yes it's helpful for spotting where you forgot to close a comment or a string or misspelt a keyword, but as Nick says it mostly eye candy.

The most useful function if this type is the greying out of inactive code (say inside an #if block) and the IDE doesn't do that. I now consider this to be a "must have" feature in an IDE.


Rob

1 Like

Hi forum,
for a 'newb' struggling to get to grips with IDE formatting, text colours, the inumerous libraries all doing the same thing but with possibly minute changes and the name change of the beloved "Arduino" to the comical "Genuino" - what do the different colours of code in the various Arduino IDE mean?
I have some variables automatically coloured orange, whereas others are coloured black - what is the difference to cause this?
Thanks
D6

You had to necro a thread from 2013 to ask that question? When it is answered in the same thread?

aarg:
You had to necro a thread from 2013 to ask that question? When it is answered in the same thread?

Probably cause the original question never got answered- which seems to be a trend. It wasn't asked what peoples opinions are about the colors. He asked what the colors meant. That said, saying they are eye candy didn't answer the question but rather answered "I ignore them". The site posted didn't offer anything having to do with colors.

The author of the IDE must have had a reason for specific colors and for noobs like me, no matter how trivial to the experienced people, we just want simple answers to the question. What do the colors represent or were intended to represent in IDE? TEAL? RED? GOLD? Etc.? Thanks for sharing the answer!

2 Likes

They're just a red herring

or an orange or teal herring.

1 Like

Just to help those just learning like me...

Functions are colour coded in orange.

Variables are colour coded in green, aqua or teal, what ever you want to call it.

and

Structure are colour coded in light greenish or what ever it is.

If you miss type or don't use exact case sensitivity for something in the IDE area such as typing "Input" this way the text will stay black. If it were typed "INPUT" it will turn the correct colour and the correct code is then usable.

As for meaning for the colours, as stated previously there is none real meaning, they are just a helpful guide.

This link below is to the arduino reference library that has a heap of colour coded programming language information...

All the "word" type language ALL work the same colour coded way in the IDE the ones that don't colour up are the ones that aren't words such as ++ or >=

2 Likes

So, for someone who has used the Arduino IDE for several years now, why are commented sections formatted so faintly they can not be read and have to be uncommented to enable reading?

The procedure is clunky but, you can change the colors. See this thread.

D6equj5:
So, for someone who has used the Arduino IDE for several years now, why are commented sections formatted so faintly they can not be read and have to be uncommented to enable reading?

It's to remind you that the comments don't always keep up with the code, so you should be wary of trusting them :stuck_out_tongue:

Or to remind you to either. wear glasses or adjust the contrast of your screen.

I've found that the colors are more distinguishable from each other, and the background, using the dark theme.

Yeah i actually also find them helpful, since i am a tad typing dyslexic, and tend to tyoe things like unit8_t which doesn't light up, and my ESP code looks totally different if i have the UNO selected as my board. I once did see a topic somewhere about using Codeblocks as an IDE but i never really managed to get that to go (Codeblocks is great though)

ChrisYoung:
Just to help those just learning like me...

Functions are colour coded in orange...

It was a relief to see that someone JUST ANSWERED THE QUESTION.

Thank you Chris!