May 14, 2017

Skill Sunday: Writing an Arduino Library

Have you ever written some code that you thought would make a great library but didn’t know where to get started? This weeks Skill Sunday will be perfect for you!

If you haven’t used libraries before they provide a really simple way to extend the functionality of the Arduino environment. For example there are libraries that make it very easy to connect to Ethernet, work with servo motors or even work with LCD displays.  

Writing a library

So how do you create your own library? First you will need to create two files, one header file (.h), which lists everything that is inside the library, and the source file (.cpp) which contains the actual code. After this you will need to take your existing sketch and appropriately fill out the header and source files. Fortunately this is quite a simple process and there is a great example available on the Arduino website.

If you are looking for a great resource to develop your Arduino skills why not checkout our Thinker Shield? The shield is ideal for beginners and includes a number of buttons, a buzzer, LEDs and more so that you can get started making all sorts of cool projects! Not only this, but you can find a fantastic project guide on our website! Checkout the product page to find out more.

Thinker Shield

Found this tutorial useful? Interested in our Thinker Shield? Let us know in the comments section below or on Facebook and Twitter.  

Leave a comment

Comments have to be approved before showing up.