Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to make and use my own arduino libraries?
How to make and use my own arduino libraries? [message #1745379] Sun, 09 October 2016 13:24 Go to next message
Gustav Borgersen is currently offline Gustav BorgersenFriend
Messages: 2
Registered: August 2016
Junior Member
Hi all!

As the topic reads, how do i create and use my own libraries when using CDT to program arduino boards. Its easy to download and use the libraries found under "Arduino download manager" but how do i make my own?
Re: How to make and use my own arduino libraries? [message #1745592 is a reply to message #1745379] Wed, 12 October 2016 20:41 Go to previous messageGo to next message
Dave Miller is currently offline Dave MillerFriend
Messages: 5
Registered: September 2016
Junior Member
I posted a similar request on Doug's Blog. Here's what I did to add a new library.
Find .arduinocdt , on my system it's under ...\<Users>\dave. There you'll find library_index.json. I had to add a block to this file similar to the other libraries already listed there. See attached .json file. Then I created a new directory under ...\.arduinocdt\libraries with the name of the library being added. Under that directory I added a directory named for the version of the library being added. Downloaded a .zip file from github of the library being added and unzipped it into the version name directory. A directory tree is attached to this post. Then closed the project in Eclipse, reopened it and used the Project Explorer view, right click on the project, Index->Rebuild Index. You can then use Project->Properties->libraries and view the libraries listed under the categories shown. The library you added should be visible. Select the new library, click Apply and OK. You may have to rebuild indexes again, not sure about that step.

Hope this helps
Re: How to make and use my own arduino libraries? [message #1749917 is a reply to message #1745592] Tue, 13 December 2016 19:47 Go to previous messageGo to next message
Dario Cimmino is currently offline Dario CimminoFriend
Messages: 6
Registered: December 2016
Junior Member
Unfortunately, This does not work for me. Can you be a bit more specific? the library I want to add is : https://github.com/sonyhome/FAB_LED is order to control the SK6812 I bought. The Adafruit neopixel library does not work for me...

What do I write in all the fields of the json file?

Re: How to make and use my own arduino libraries? [message #1749999 is a reply to message #1749917] Thu, 15 December 2016 01:25 Go to previous messageGo to next message
Dave Miller is currently offline Dave MillerFriend
Messages: 5
Registered: September 2016
Junior Member
Oddly enough, the following block that was added to the library_index.json file disappeared from the system apparently due to an Eclipse update on 11/23/2016.
See annotations in the following: mu == made up; new == derived from source; copied == copied from an existing block just to get the sytax correct

{
"name": "genieArduino", mu
"version": "06-10-2015", new, source git-hub
"author": "4D-Laboratories", mu
"maintainer": "4D-Laboratories", mu
"sentence": "Arduino Library for Visi-Genie", mu
"paragraph": "Supports 4D-Laboratories Picasso based lcd displays", mu
"website": "https://github.com/4dsystems/ViSi-Genie-Arduino-Library", new, source github.com searched for the library name I was looking for
"category": "Sensors", mu, probably not the best choice but didn't find one for displays
"architectures": [ copied from an existing block
"*"
],
"types": [ copied from an existing block
"Contributed"
],
"url": "https://github.com/4dsystems/ViSi-Genie-Arduino-Library", new, source github
"archiveFileName": "genieArduino-016-06-2015.zip", mu
"size": 26113, can't remember
"checksum": "SHA-256:d03c355588958ede15822a3ea25ca4387c5a154a44209766212b74636bd9338f" new, source github
}
]
}

hope this helps
Re: How to make and use my own arduino libraries? [message #1750000 is a reply to message #1749999] Thu, 15 December 2016 01:35 Go to previous messageGo to next message
Dario Cimmino is currently offline Dario CimminoFriend
Messages: 6
Registered: December 2016
Junior Member
It does! But I am fairly new With eclipse, I think I am doing something wrong... Here is what I added at the end of my file.

{
"name": "FAB_LED",
"version": "0.1.0",
"author": "SonyHome",
"maintainer": "SonyHome",
"sentence": "Fast Arduino Bitbang (FAB) LED library.",
"paragraph": "This library is meant to be a very compact, fast library to drive your addressable LEDs.",
"website": "https://github.com/sonyhome/FAB_LED",
"category": "Display",
"architectures": [
"*"
],
"types": [
"Recommended"
],
"url": "https://github.com/sonyhome/FAB_LED/archive/master.zip",
"archiveFileName": "FAB_LED-master.zip",
"size": 264693,
"checksum": "SHA-1:e9437a33f7b77f4b52da1854582a01dc058c58c0"
}

How did you get the checksum? Is it provided by github? After refreshing the index I still don't see it. Any ideas? Thank you for your reply.
D.
Re: How to make and use my own arduino libraries? [message #1750003 is a reply to message #1750000] Thu, 15 December 2016 03:52 Go to previous messageGo to next message
Dave Miller is currently offline Dave MillerFriend
Messages: 5
Registered: September 2016
Junior Member
Under the following directory there is a file library.properties. I looked at it with Notepad and it contains a version number but no checksum. If there isn't one on github
I'm not sure what to say. It's possible I made that up too?

C:\Users\Dave\.arduinocdt\libraries\genieArduino\20151006
Notice the last directory is the version number in the libary_index.json file. I didn't notice this file was there when I first got this working, probably could have just pasted this file into the libary_index.json file
under .arduinocdt. Have no idea how the checksum gets used.

I'm getting the idea that once you get this working, Eclipse follows the link to github for any new build or after "clean"ing the project. But I think you have to put the new library
block in the .json file in order for the Eclipse menu system to show the library under Project -> Properties -> libraries. I really am guessing here. Anyway, make sure that after adding
the library to the .json file that you go through Project -> Properties -> libraries and select the new library just added. You might also try closing the project and restarting Eclipse after the .json
file has been fixed.

Any one else out there who might be able to shed light on how this all works?

Re: How to make and use my own arduino libraries? [message #1750068 is a reply to message #1750003] Thu, 15 December 2016 16:43 Go to previous messageGo to next message
Dario Cimmino is currently offline Dario CimminoFriend
Messages: 6
Registered: December 2016
Junior Member
I think I am on to something. When I save my file and reopen it it works. If I rebuild the index the file gets overridden and get back to another state. Any Ideas?
Re: How to make and use my own arduino libraries? [message #1750070 is a reply to message #1750068] Thu, 15 December 2016 17:32 Go to previous messageGo to next message
Dario Cimmino is currently offline Dario CimminoFriend
Messages: 6
Registered: December 2016
Junior Member
I can't believe how hard it is too add a library to a project. I tried linking it, putting it in the same folder.. nada. I think ill go with the Slober plugin instead. or worse, go back to the arduino IDE!
Re: How to make and use my own arduino libraries? [message #1750087 is a reply to message #1750070] Fri, 16 December 2016 00:12 Go to previous messageGo to next message
Dario Cimmino is currently offline Dario CimminoFriend
Messages: 6
Registered: December 2016
Junior Member
When you open arduino downloads manager, it downloads the library_index.json file. if I modify it, then look at project->libraries it is not there. A simple way would be to add it to the download list, but i can't do that.
Re: How to make and use my own arduino libraries? [message #1751055 is a reply to message #1750087] Tue, 03 January 2017 23:51 Go to previous messageGo to next message
Paul Carew is currently offline Paul CarewFriend
Messages: 12
Registered: May 2013
Junior Member
I may have discovered something which may help.
I was having an issue with a platform library. The library files existed in the directory tree, but the library wasn't showing up in the project libraries preference list.

To cut a long story short, there should be a 'library.properties' file in the root of the library concerned. This was missing for the library that I needed. When I created this file, the library suddenly showed up in the project libraries preference list.

It seems that the project library list is created dynamically probably when a 'build' is initiated.

I would check that you have this file in you library root folder and then rebuild. After this, check to see if the file has appeared in the project preferences and can be selected.

YMMV of course
Paul.
Re: How to make and use my own arduino libraries? [message #1752738 is a reply to message #1751055] Thu, 26 January 2017 18:03 Go to previous messageGo to next message
Dario Cimmino is currently offline Dario CimminoFriend
Messages: 6
Registered: December 2016
Junior Member
Hello Paul, This file does not exist in the github library. Do I have to contact the creator to make one or I can make a dummy file myself?

On a unrelated note, I do not know what YMMV stands for. A new brand of car? Laughing

Thanks for the help, I will pick up my project again when I get home!

Dario.
Re: How to make and use my own arduino libraries? [message #1752744 is a reply to message #1752738] Thu, 26 January 2017 20:11 Go to previous message
Paul Carew is currently offline Paul CarewFriend
Messages: 12
Registered: May 2013
Junior Member
Hello Dario,
Yes, I created a 'dummy' one myself. and put it in the local library folder. It is a simple text file with the library properties. You can look at other library root folders for some examples.

In addition, it is not a bad idea also to drop the creator/author a request to create an 'official' file and have it added to the repository also.

YMMV -> "Your Mileage May Vary"
It just means that your results / experience may be different from mine.
Previous Topic:Differences between "ELF Parser" and "GNU ELF Parser"?
Next Topic:Skipping incompatible error when using arm-linux-gnueabihf on beaglebone black
Goto Forum:
  


Current Time: Fri Jan 28 02:11:10 GMT 2022

Powered by FUDForum. Page generated in 0.02793 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top