[Solved] Installing libraries - think I've tried everything but it wont work.


I hope I'm not adding a new thread that isn't needed but I've looked around and followed all the tips and tricks i could find.

I'm trying to install the Button library by Michael Adams by using "Manage libraries...". I've also tried doing it with "Add .ZIP libraries" and by downloading and unzipping the library manually and then extracting the files to the sketchbook folder.

I made sure the name of the library folder, the .h file and the .cpp file all were the same (Button). I made sure that the main library folder "Button" was put in the "Libraries" folder in my sketchbook folder.

The text won't turn orange when i write button after i added the library in my sketch. The library shows in the list of libraries installed so now i feel like throwing my computer out the window... but I won't.

I'm new to this and help is much appreciated, cheers!

Turning orange is not important. What does it do when you verify a sketch with it included and used?


Hi Steve,

You were right, i just finished the sketch and uploaded it and it works. Should have done that before posting. Thought the text going orange indicated that the library was in use or something, like when i print Serial.print etc.. But now i know! :slight_smile: Thank you for your quick reply!


Library authors have the option of creating a keywords.txt file, which has a list of the keywords they want colored after their library is installed. Some library authors don't bother to do it. Other library authors do it but don't do it correctly so it doesn't work. So don't worry about coloration. What really matters is whether the code compiles.

In this case the problem was that there is a keywords.txt file but it wasn't correctly formatted. I have submitted a proposal to fix this:

Hi Pert,

tank you for your quick reply! Now things make alot more sense. I’ve continued doing my sketches not bothering with the highlights but it feels like having them highlighted makes the code easier to read so i’m gonna try your solution. The fix you proposed, is it a template to use so I can rewright the keyword.txt and correct it or do i copy/pase something. New to this so i wasn’t quite sure how to aply the fix.

Big thanks!

My pull request has been merged into the Button library but there has not been a new release made since then so it's not yet possible to update it using Sketch > Include library > Manage libraries.

If you want to implement the fix on the version of the library you have installed you only need to replace the file keywords.txt that's in the root of the Button library folder with this one:

Awesome, works great! Thank you!

The Button library has been throwing problems for a while now, so tend to ignore the warnings. Ought to delete it really.