Skip to content
ivanseidel edited this page May 19, 2013 · 1 revision

[This Documentation is under development]


ArdUI Basic

You must be tinking: “What the hell is ArdUI?”, in short, it’s a Arduino User Interface. Because of the encreasing use of LCD displays with Touch capabilities, at some point in Time, there must be some organization, a design patter, or, an base for all projects.

ArdUI was coded thinking on most people who likes to do incredible stuff with Arduino, but waste lots of time doind the “Boring” stuff of the thing and not the REAL job.

Since I started working with Arduino, I felt just that: The lack of good and robust Libraries to use with my Robots (check it out at: Tenda Digital, I “wasted” a lot of time preparing a single base to my robots. That, included:

ArdUI, Uses the UTFT and UTouch library and incorporates the power of Object Oriented software, with Timers and Interrupts to create the most simple to use (and also complex to create) User Interface for Arduino.

ArdUI is based entirely on a simplified version of Android. It has `View`, `GroupView`, `CheckBox` and many others just ready to use. Isn’t there something you need? Just created. We have given you the BASE for creating whatever you need, in a few minutes. Just follow the code already done, and you will see how fast development can be.

Handling touches

ArdUI was made to be powerfull in the same time that can be very fast. We implemented the BEST touch controller, that uses both Timer and Interrupts to act, consuming just enough “CPU” to get it run, and left the rest to the main process (`loop`).

Callbacks and Events

Why should we not be using callbacks on Arduino? “It’s not fast enough”, “good enought”… Just bulshit.

The entire ArdUI is based on callbacks. onChange, onClick, onTouch… Set the callback and foget about checking hundreds of thousands of times `if` something. Do things parallel to your code, and be happy.

It’s also implemented, and running ActionEvents on screen, such as:

  • ACTION_DOWN (When a view is pressed)
  • ACTION_MOVE (When the finger moves OVER a view)
  • ACTION_HOVER_ENTER, ACTION_HOVER_EXIT, ACTION_UP

Views and Design pattern

We already implemented the basic for you. Fell free to create your own views, and don’t forget to send it to me, so I can share it on gitHub also.

Views are implemented using a pattern, derived also from Android (The only change, is that `onDraw` becomes `onRender`, since Android cannot hold so many cached bytes).

Here is a simple example of the powerfull:

Button myBtn = Button();
myBtn.onClick(callback);

SeekBar mySkBr = SeekBar();
mySkBr.onChange(valueChanged_callback);
mySkBr.o = Point(50,30); // Set position to 50, 30

MyRootView.addView(&myBtn);
MyRootView.addView(&mySkBr);

Documentation

ArdUI class

ArdUI static class is responsable for dealing with touches on the screen and sending events to `Views`.

Go to Touch Controller to learn more

Views

It has up and running `Views` such as: Button, ProgressBar, SeekBar, CheckBox, TextView.

All implemented with callbacks configuration methods. If you want to edit or make a different kind of view, fell free to extend one of those classes.