From 24dafcc8bb396bd7735c8853c1ee34d6e4e128c8 Mon Sep 17 00:00:00 2001 From: Lukas Bachschwell Date: Wed, 29 Nov 2017 11:35:54 +0100 Subject: [PATCH] update readme and example --- README.md | 11 ++++++----- examples/gui/gui.ino | 6 ++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3bf03b7..1c50dca 100644 --- a/README.md +++ b/README.md @@ -56,16 +56,13 @@ Now you are set to go and use any code you want to with this library - Switch (updateable) - Control pad - Control pad with center button + - Slider Checkout the example for the usage ## Roadmap : -- refactor id system -- make button colour customisable -- do a proper redesign -- cleanup unnecessary CSS -- gzip files to make them load faster +- Document slider - setup spiffs using values in program memory ? (if you have feedback to this idea let me know) - ESP8266 support @@ -107,6 +104,10 @@ Button pads come in two flavours: with or without a center button. They are very 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. +#### Slider + +There is also an slider component now, needs to be documented though + #### 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. diff --git a/examples/gui/gui.ino b/examples/gui/gui.ino index 90b924b..277704b 100644 --- a/examples/gui/gui.ino +++ b/examples/gui/gui.ino @@ -40,6 +40,8 @@ void setup(void) { ESPUI.pad("Pad without center", false, &padExample, COLOR_CARROT); ESPUI.switcher("Switch one", false, &switchExample, COLOR_ALIZARIN); ESPUI.switcher("Switch two", true, &otherSwitchExample, COLOR_NONE); + ESPUI.slider("Slider one", &slider, COLOR_ALIZARIN, "30"); + ESPUI.slider("Slider two", &slider, COLOR_NONE, "100"); ESPUI.begin("ESP32 Control"); } @@ -53,6 +55,10 @@ void loop(void) { } } +void slider(Control sender, int type) { + Serial.println(sender.value); +} + void buttonCallback(Control sender, int type) { switch (type) { case B_DOWN: