Posted on Leave a comment

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 tutorial 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, control 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.

Want to keep in the loop about the latest in home automation? Subscribing to SuperHouse Automation on YouTube is the best place to start!

Inspired to start work on this project? Are you working on a project you would like us to feature in this blog? The team at SuperHouse Automation would love to know! Tell us about it in the comments section below or on Facebook and Twitter.

Posted on Leave a comment

Arduino Arrays

This blog post is about learning how to use arrays with Arduino. Using arrays in your code can make your code faster and much more readable. For example, rather than defining a new variable for each pin used in your Arduino code, having an array allows you to assign these all to one array. To access each pin in the array you simply define which address of the array you would like to access. If you would like a more thorough explanation of how Arduino arrays work to implement them in your code make sure you checkout the following link.

Arrays

If you are thinking about getting started with Arduino, but don’t know where to get started, the Freetronics Experimenter’s Kit is a great way to learn the basics. The kit includes a wide range of parts including a servo, sensors, lights, buttons, a sound module and more. Importantly, a Freetronics Eleven Arduino-compatible board is included to ensure that the kit contains everything you need to get started with Arduino. All these great parts would be useless without some form of instructions which is why we have developed a comprehensive project and instruction booklet to get you started. Check out the product page to find out more.

Want to keep in the loop about the latest in home automation? Subscribing to SuperHouse Automation on YouTube is the best place to start!

Inspired to start work on this project? Are you working on a project you would like us to feature in this blog? The team at SuperHouse Automation would love to know! Tell us about it in the comments section below or on Facebook and Twitter.

 SuperHouse-LogoOnly-512x512