Skip to content
André Pires edited this page Oct 27, 2017 · 28 revisions

Easyuino

Disclaimer!!!: I am not an Electrotechnical Engineer, not even an expert, I'm a simple Computer Scientist and Engineer that is an enthusiast of Arduino probably as the users of the Easyuino library, so my knowledge in electronics is not the best.

In this wiki, I will try to maintain a set of examples for each supported device with a simple electronic scheme on how to mount the circuit using Arduino Uno and an example of the code using the Easyuino API with common use cases. After the examples are done if my time allows it I will try to write/maintain a more detailed API specification.

Getting Started

  1. Use GitHub download green button to get the library as a .zip file
  2. Using Arduino IDE got to menu bar choose Sketch > Include Library and select the .zip file downloaded in 1.
  3. Have fun!!!

Advice: See the section of Examples to catch the usage idea easily together with a set of common usages for each sensor/device.

Usage Examples

Important!!: When looking for how to use a device look at the examples below from the left to right because the left ones are the simples and have a limited set of features that probably will be enough for beginners. The examples at right normally provide more advanced features that are improvements over the basic ones.

Links for the usage examples per sensor/device:

Note: These Examples are exactly the same as the ones in the examples folder of the library

API Version System

vMajor.Middle.Minor (e.g: v1.1.2)

The rules for the 3 digit version system are simple and described next:

  1. The first version launched was the v1.0.0
  2. The Major number is incremented when there are made huge changes (many features introduced and the library looks very different) OR something is changed and breaks the compatibility with the previous version
  3. The Middle number is incremented when new functionalities are added (e.g: Relay API supports a new feature)
  4. The Minor number is incremented when bugs are fixed or very small and unnoticed changes are made to the library

Important Features (Advanced)

Static Memory Allocation

One of the most important thing in low level programming is efficiency and small memory usage (e.g: Arduino Uno Rev3 has 2KB of SRAM to run the program).

So I decided to use static memory allocation whenever possible to maintain heap fragmentation at bay. Whenever possible I decided to allocate the resources statically and only in special cases use dynamic allocation. This decision limits the API but it is a trade-off to maintain safe programs especially for beginners and at the same time try to use the minimum memory possible. If someone needs more resources can adjust the self-explanatory constants in header files.

Modular API

Most of Arduino boards have a very little ROM memory to store code (e.g: Arduino Uno Rev3 has 28KB available to store code). To reduce the library footprint I made the API modular explained below with a simple example:

Relay simpleRelay = Relay();
simpleRelay.doCommonFunction();
//...
RelayAdvanced advancedRelay = RelayAdvanced();
advancedRelay.doCommonFunction();
advancedRelay.doAdvancedFunction();

In the example, we can see that the RelayAdvanced can do the same and more than Relay but will have more methods and need more memory. The user only needs to choose the one that offers the minimum functionality it needs.

Clone this wiki locally