-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Disclaimer!!!: I am not an Electrotechnical Engineer, not even an expert, I'm a simple enthusiastic hobbyist as probably the users of the Easyuino library so my knowledge in electronics is very limited.
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.
- Use GitHub download green button to get the llibrary as a .zip file
- Using your favorite IDE add the library selecting .zip file
- Using Arduino IDE got to to menu bar choose Sketch > Include Library and select the .zip file downloaded in 1.
- 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.
Links for the usage examples per device:
- Relay examples (Relay, Named Relay, ...)
- Displays examples (OLED Lcd, Seven Segments Display , ...)
- Infra-Red Receiver examples (Simple Infra Red receiver, ...)
- Leds examples (RGB led, ...)
- Water Detector examples (Simple Rain Detector, ...)
- Ultrasonic module (Ulrasonic as Distance Meter , ...)
Note: These Examples are the same that are in the examples folder of Easyuino library.
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.
Most of Arduinos 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();
simpleRelay.doCommonFunction();
//...
RelayAdvanced advancedRelay();
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.
vMajor.Middle.Minor (e.g: v1.1.2)
The rules for the 3 digit version system are simple and described next:
- The first version launched was the v1.0.0 (It was a bit incomplete when launched)
- The Major number is incremented when there are made huge changes in the library or something is changed and breaks the compatibility with previous versions
- The Middle number is incremented when new functionalities are added (e.g: Relay API supports a new feature)
- The Minor number is incremented when bugs are fixed or very small and unnoticed changes are made to the library