diff --git a/README.md b/README.md index daa1868..2d918a1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # ESPUI -![ESPUI Controlpad](https://github.com/s00500/ESPUI/blob/master/docs/controlpad.png) -![ESPUI Switch](https://github.com/s00500/ESPUI/blob/master/docs/switch.png) +![ESPUI](https://github.com/s00500/ESPUI/blob/master/docs/ui_complete.png) ESPUI is a simple library to make a web user interface for your projects using the **ESP32** @@ -77,5 +76,41 @@ ESPUI's frontend is based on [Skeleton CSS](http://getskeleton.com/) and jQuery- ESPUI does not need network access and can be used in standalone access point mode. All assets are loaded from the internal SPIFFS filesystem of the ESP32. +This section will explain in detail how the Library is to be used from the Arduino code side. As of now the Facilino blocks are not implemented. +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 + +![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. + + +## Switch + +![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. + + +## Buttonpad + +![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. + + +## Labels + +![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. +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. +The library is designed to be easy to use and can still be extended with a lot of more functionality. + + # Contribute Liked this Library? You can Support me by sending me a :coffee: [Coffee](https://paypal.me/lukasbachschwell/3). diff --git a/docs/switch.png b/docs/ui_button.png similarity index 50% rename from docs/switch.png rename to docs/ui_button.png index 3a68179..43b8b7a 100644 Binary files a/docs/switch.png and b/docs/ui_button.png differ diff --git a/docs/ui_complete.png b/docs/ui_complete.png new file mode 100644 index 0000000..f09b21a Binary files /dev/null and b/docs/ui_complete.png differ diff --git a/docs/controlpad.png b/docs/ui_controlpad.png similarity index 100% rename from docs/controlpad.png rename to docs/ui_controlpad.png diff --git a/docs/ui_labels.png b/docs/ui_labels.png new file mode 100644 index 0000000..f38cb37 Binary files /dev/null and b/docs/ui_labels.png differ diff --git a/docs/ui_status.png b/docs/ui_status.png new file mode 100644 index 0000000..c01199c Binary files /dev/null and b/docs/ui_status.png differ diff --git a/docs/ui_switches.png b/docs/ui_switches.png new file mode 100644 index 0000000..e995fb5 Binary files /dev/null and b/docs/ui_switches.png differ