1
0
mirror of https://github.com/s00500/ESPUI.git synced 2024-11-05 00:00:54 +00:00

more documentation refinements

This commit is contained in:
Lukas Bachschwell 2017-11-13 11:17:58 +01:00
parent d13d471bc6
commit 47aaedfa9a

View File

@ -13,6 +13,34 @@ I completely rewrote the EasyUI Library created by ayushsharma82 [Here](https://
Now it uses ESPAsyncWebserver and is mainly to be used with the ESP32 Processor. Now it uses ESPAsyncWebserver and is mainly to be used with the ESP32 Processor.
ESP8266 support will be interesting maybe in the future. ESP8266 support will be interesting maybe in the future.
## Dependencies
This library is dependent on the following libraries to function properly.
- [ESP32 Core Library](https://github.com/espressif/arduino-esp32)
- [ESPAsyncWebserver](https://github.com/me-no-dev/ESPAsyncWebServer)
- [ArduinoJson](https://github.com/bblanchon/ArduinoJson)
## How to Install
Make sure all the dependencies are installed, then install like so:
#### Directly Through Arduino IDE
You can find this Library in the Arduino IDE library manager
Go to Sketch > Include Library > Library Manager > Search for "EasyUI" > Install
#### Manual Install
For Windows: Download the [Repository](https://github.com/s00500/ESPUI/archive/master.zip) and extract the .zip in Documents>Arduino>Libraries>{Place "ESPUI" folder Here}
For Linux: Download the [Repository](https://github.com/s00500/ESPUI/archive/master.zip) and extract the .zip in Sketchbook/Libraries/{Place "ESPUI" folder Here}
For macOs: Download the [Repository](https://github.com/s00500/ESPUI/archive/master.zip) and extract the .zip in ~/Documents/Arduino/libraries/{Place "ESPUI" folder Here}
#### Manually through IDE
Download the [Repository](https://github.com/s00500/ESPUI/archive/master.zip), Go to Sketch>Include Library>Add .zip Library> Select the Downloaded .zip File.
## Getting started (Filesystem upload) ## Getting started (Filesystem upload)
ESPUI **NEEDS** its files burnt on the SPIFFS filesystem on the ESP. **Without this ESPUI will NOT work at all** ESPUI **NEEDS** its files burnt on the SPIFFS filesystem on the ESP. **Without this ESPUI will NOT work at all**
@ -22,34 +50,6 @@ To do this download and install me-no-devs wonderful [ESP32 sketch data uploader
Then open the example sketch and select "ESP32 Upload Sketch Data" from the Tools menu. Then open the example sketch and select "ESP32 Upload Sketch Data" from the Tools menu.
Now you are set to go and use any code you want to with this library Now you are set to go and use any code you want to with this library
## How to Install
###### Directly Through Arduino IDE
THIS IS NOT DONE YET
~~Go to Sketch > Include Library > Library Manager > Search for "EasyUI" > Install~~
###### Manual Install
For Windows: Download the [Repository](https://github.com/s00500/ESPUI/archive/master.zip) and extract the .zip in Documents>Arduino>Libraries>{Place "ESPUI" folder Here}
For Linux: Download the [Repository](https://github.com/s00500/ESPUI/archive/master.zip) and extract the .zip in Sketchbook/Libraries/{Place "ESPUI" folder Here}
For macOs: Download the [Repository](https://github.com/s00500/ESPUI/archive/master.zip) and extract the .zip in ~/Documents/Arduino/libraries/{Place "ESPUI" folder Here}
###### Manually through IDE
Download the [Repository](https://github.com/s00500/ESPUI/archive/master.zip), Go to Sketch>Include Library>Add .zip Library> Select the Downloaded .zip File.
## Dependencies
This library is dependent on the following libraries to function properly.
- [ESP32 Core Library](https://github.com/espressif/arduino-esp32)
- [ESPAsyncWebserver](https://github.com/me-no-dev/ESPAsyncWebServer)
- [ArduinoJson](https://github.com/bblanchon/ArduinoJson)
## User interface Elements ## User interface Elements
- Label (updateable) - Label (updateable)
- Button - Button
@ -80,37 +80,38 @@ This section will explain in detail how the Library is to be used from the Ardui
In the arduino setup() routine the interface can be customised by adding UI Elements. This is done by calling the corresponding library methods on the Library object ESPUI. Eg: ESPUI.button(“button”, &myCallback); creates a button in the interface that calls the “my-Callback” function when changed. All buttons and items call their callback whenever there is a state change from them. This means the button will call the callback when it is pressed and also again when it is released. To seperate different events an integer number with the event name is passed to the callback function that can be handled in a switch(){}case{} statement. Here is an overview of the currently implemented different elements of the UI library: In the arduino setup() routine the interface can be customised by adding UI Elements. This is done by calling the corresponding library methods on the Library object ESPUI. Eg: ESPUI.button(“button”, &myCallback); creates a button in the interface that calls the “my-Callback” function when changed. All buttons and items call their callback whenever there is a state change from them. This means the button will call the callback when it is pressed and also again when it is released. To seperate different events an integer number with the event name is passed to the callback function that can be handled in a switch(){}case{} statement. Here is an overview of the currently implemented different elements of the UI library:
## Button #### Button
![Buttons](https://github.com/s00500/ESPUI/blob/master/docs/ui_button.png) ![Buttons](https://github.com/s00500/ESPUI/blob/master/docs/ui_button.png)
Buttons have a name and a callback value. They have one event for press and one for release. Buttons have a name and a callback value. They have one event for press and one for release.
## Switch #### Switch
![Switches](https://github.com/s00500/ESPUI/blob/master/docs/ui_switches.png) ![Switches](https://github.com/s00500/ESPUI/blob/master/docs/ui_switches.png)
Switches sync their state on all connected devices. This means when you change their value they change visibly on all tablets or computers that currently display the interface. They also have two types of events: one for turning on and one for turning off. Switches sync their state on all connected devices. This means when you change their value they change visibly on all tablets or computers that currently display the interface. They also have two types of events: one for turning on and one for turning off.
## Buttonpad #### Buttonpad
![control pads](https://github.com/s00500/ESPUI/blob/master/docs/ui_controlpad.png) ![control pads](https://github.com/s00500/ESPUI/blob/master/docs/ui_controlpad.png)
Button pads come in two flavours: with or without a center button. They are very useful for con-trolling all kinds of movements of vehicles or also of course our walking robots. They use a single callback per pad and have 8 or 10 different event types to differentiate the button actions. Button pads come in two flavours: with or without a center button. They are very useful for con-trolling all kinds of movements of vehicles or also of course our walking robots. They use a single callback per pad and have 8 or 10 different event types to differentiate the button actions.
## Labels #### Labels
![labels](https://github.com/s00500/ESPUI/blob/master/docs/ui_labels.png) ![labels](https://github.com/s00500/ESPUI/blob/master/docs/ui_labels.png)
Labels are a nice tool to get information from the robot to the user interface. This can be done to show states, values of sensors and configuration parameters. To send data from the code use ESP.print(labelId, “Text”); . Labels get a name on creation and a initial value. The name is not changeable once the UI initialized. Labels are a nice tool to get information from the robot to the user interface. This can be done to show states, values of sensors and configuration parameters. To send data from the code use ESP.print(labelId, “Text”); . Labels get a name on creation and a initial value. The name is not changeable once the UI initialized.
Initialization of the UI
#### Initialization of the UI
After all the elements are configured you can use ESPUI.begin(“Some Title”); to start the UI interface. The web interface can then be used from multiple devices at once and also shows an connection status in the top bar. After all the elements are configured you can use ESPUI.begin(“Some Title”); to start the UI interface. The web interface can then be used from multiple devices at once and also shows an connection status in the top bar.
The library is designed to be easy to use and can still be extended with a lot of more functionality. The library is designed to be easy to use and can still be extended with a lot of more functionality.
# Contribute # Contribute
Liked this Library? You can Support me by sending me a :coffee: [Coffee](https://paypal.me/lukasbachschwell/3). Liked this Library? You can **support** me by sending me a :coffee: [Coffee](https://paypal.me/lukasbachschwell/3).