0

I am new to creating a library in Arduino. I was able to create a library from YouTube. I want to merge two other libraries into the library I created. Can you please help me to do so?

I already created a keywords.txt file for my library but the keywords are not getting highlighted in orange in the IDE. But it identifies as keywords.

Please guide me how to properly create a keywords file and merge the libraries.

Keywords below:

# -----------------------------------------------------------------------------------
# Syntax coloring for IotBlueEmon library
# -----------------------------------------------------------------------------------

# Datatypes (such as objects)
CurrentSense KEYWORD1

#Methods / functions
begin   KEYWORD2
Counter1   KEYWORD2
Counter2   KEYWORD2
counter3   KEYWORD2
getCNT1   KEYWORD2
getCNT2   KEYWORD2
getCNT3   KEYWORD2

# Constants
1
  • 1
    please delete the comment. it clutters up the post. you have added it correctly to the question. (there is a little red X next to the comment. it shows up when you hover the mouse pointer over the comment)
    – jsotola
    Jan 5, 2018 at 7:31

1 Answer 1

1

If you consult the Arduino Library Specification's section on keywords.txt:

A tab should be used to separate each name from the KEYWORD1/Keyword2/Literal1 identifier.

A true tab character is required, rather than spaces, as you have in your keywords.txt. It is common for text editors to be configured to add a given number of spaces when the tab key is pressed rather than a true tab character. That's great but in this case you will need to be sure that the tab character is used.

Note that the tab requirement will be relaxed in the Arduino IDE 1.9.0 release, which will also accept space(s) as a keywords separator but it's still best to use tabs for backwards compatibility since people will be using pre-1.9.0 IDE versions for years to come.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.