1
0
mirror of https://github.com/s00500/ESPUI.git synced 2024-06-28 07:54:12 +00:00

Color none, update example

This commit is contained in:
Lukas Bachschwell 2017-11-14 12:12:12 +01:00
parent fa45d9033b
commit 6da6c3841b
3 changed files with 24 additions and 9 deletions

View File

@ -21,6 +21,7 @@ const C_WETASPHALT = 3;
const C_SUNFLOWER = 4; const C_SUNFLOWER = 4;
const C_CARROT = 5; const C_CARROT = 5;
const C_ALIZARIN = 6; const C_ALIZARIN = 6;
const C_NONE = 7;
function colorClass(colorId){ function colorClass(colorId){
colorId = Number(colorId); colorId = Number(colorId);
@ -52,8 +53,13 @@ function colorClass(colorId){
case C_ALIZARIN: case C_ALIZARIN:
return "alizarin" return "alizarin"
break; break;
case C_NONE:
return ""
break;
default: default:
return "alizarin"; return "";
} }
} }

View File

@ -32,15 +32,23 @@ void setup(void) {
Serial.println(WiFi.localIP()); Serial.println(WiFi.localIP());
*/ */
ESPUI.label("Status:", 0, "Stop"); ESPUI.label("Status:", COLOR_TURQUOISE, "Stop");
ESPUI.label("Millis:", 1, "0"); ESPUI.label("Millis:", COLOR_EMERALD, "0");
ESPUI.button("Push Button", &buttonCallback, 2); ESPUI.button("Push Button", &buttonCallback, COLOR_PETERRIVER);
ESPUI.button("Other Button", &buttonExample, 3, "Press" ); ESPUI.button("Other Button", &buttonExample, COLOR_WETASPHALT, "Press" );
ESPUI.pad("Pad with center", true, &padExample, 4); ESPUI.pad("Pad with center", true, &padExample, COLOR_SUNFLOWER);
ESPUI.pad("Pad without center", false, &padExample, 5); ESPUI.pad("Pad without center", false, &padExample, COLOR_CARROT);
ESPUI.switcher("Switch one", false, &switchExample, 6); ESPUI.switcher("Switch one", false, &switchExample, COLOR_ALIZARIN);
ESPUI.switcher("Switch two", true, &otherSwitchExample, 0); ESPUI.switcher("Switch two", true, &otherSwitchExample, COLOR_TURQUOISE);
#define COLOR_TURQUOISE 0
#define COLOR_EMERALD 1
#define COLOR_PETERRIVER 2
#define COLOR_WETASPHALT 3
#define COLOR_SUNFLOWER 4
#define COLOR_CARROT 5
#define COLOR_ALIZARIN 6
ESPUI.begin("ESP32 Control"); ESPUI.begin("ESP32 Control");
} }

View File

@ -63,6 +63,7 @@ typedef struct Control {
#define COLOR_SUNFLOWER 4 #define COLOR_SUNFLOWER 4
#define COLOR_CARROT 5 #define COLOR_CARROT 5
#define COLOR_ALIZARIN 6 #define COLOR_ALIZARIN 6
#define COLOR_NONE 6
class ESPUIClass { class ESPUIClass {