Help me with a lbrary

I have recently installed a library and I tried running an example and the library example has a library definition that is not recognized

Post the code. Read the forum guidelines to see how to properly post code and some information on how to get the most from this forum.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

Please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.

It would help if you said which library.

It would help if you said which example.

Hi @bobdabuilder676.

I'm not sure what you mean by "not recognized". Are you referring to the fact that the U8g2lib in this line of your sketch in the screenshot does not have any sort of special coloration?:

#include <U8g2lib.h>

If so, that is normal and expected. Each library author can chose to define a list of keywords that can be colored in the Arduino IDE when their library is installed.

Sometimes one of those keywords defined by the library author matches the file name of a header file of the library, causing it to have a special color. But not always. Some library authors don't bother with keywords, some define them incorrectly so they are not recognized by the Arduino IDE, or some define them incompletely because they forgot to add new ones.

For the U8g2 library, they simply have not defined a keyword for U8g2lib, so the IDE does not color it even when the library is installed and working perfectly.

So don't be too concerned with the colors of things in the Arduino IDE. Keyword coloration is purely a cosmetic feature and has no impact on the actual function of the code.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.