mirror of
https://github.com/s00500/ESPUI.git
synced 2024-12-23 00:40:49 +00:00
update readme and example
This commit is contained in:
parent
09e3a9c71b
commit
24dafcc8bb
11
README.md
11
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.
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user