Version 1.0.1
aREST UI is an embedded UI for the aREST framework. Currently works with the Arduino Mega & Arduino Due with the CC3000 WiFi chip, the WiFi shield, and the Ethernet shield. It works as well with the WildFire v3 board.
It also works with the ESP8266 WiFi chip.
If you want to know more about aREST, go over to http://arest.io/.
- aREST_UI.h: the library file.
- examples: several examples using the aREST UI library
To use the library with Arduino boards you will need the latest version of the Arduino IDE:
You will also need the aREST library:
- Adafruit CC3000 Library
- Adafruit MDNS Library
- MDNS support in your operating system:
To install the library, simply clone this repository in the /libraries folder of your Arduino folder.
- Connect a LED & resistor to pin number 6 of your Arduino Mega board
- Open the WiFi_CC3000 example sketch and modify the WiFi SSID and password
- Upload the sketch to the board
- Go to a web browser and type
http://arduino.local
- Click on the 'On' button and the LED should turn on
- Connect a LED & resistor to pin number 6 of your WildFire board
- Open the WildFire example sketch and modify the WiFi SSID and password
- Upload the sketch to the board
- Go to a web browser and type
http://wildfire.local
- Click on the 'On' button and the LED should turn on
You can simply create an instance of aREST UI with the following command:
aREST_UI ui = aREST_UI();
If you don't want to run with the default title, set your own for the UI.
ui.title("Your title");
Buttons are used to control the state of a digital output pin. The command creates two button inside the interface, one 'On' button, and one 'Off' button. For example, the following command creates a pair of buttons to control pin number 6:
ui.button(6)
The slider command creates a slider to control a pin via PWM. For example, it can be used to control the intensity of a LED connected to this pin. The following command creates a pair of buttons to control pin number 6:
ui.slider(6)
;
Labels are used to display the value of variables inside the interface. Before you can use this command, you need to create the corresponding variable first. The following command declares a variable called temperature:
ui.variable("temperature",&temperature);
After that, you can use the following command to create the corresponding label inside the interface:
ui.label("temperature")
;