Код:
#include <GyverPortal.h>
GyverPortal ui;
void build() {
GP.BUILD_BEGIN(GP_DARK);
M_BLOCK_TAB(
"Настройки",
GP.LABEL("Питание");
GP.SWITCH("pwr");
GP.BREAK();
GP.LABEL("Яркость");
GP.SLIDER("brg", 0, 255);
)
}
void action() {
if (ui.click()) {
if ( ui.click("brg") ) {
FastLED.setBrightness(ui.getInt("brg"));
Brightness = ui.getInt("brg");
FastLED.show()
}
if ( ui.click("pwr") ) {
for (int i = Brightness; i > 0; i--) {
FastLED.setBrightness(i);
FastLED.show();
}
}
}
}
При компиляции происходит ошибка:
Arduino: 1.8.19 (Windows 10), Плата:"LOLIN(WEMOS) D1 R2 & mini, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"
C:\Users\Вульф\OneDrive\Документы\Arduino\SmartLamp\SmartLamp.ino: In function 'void build()':
SmartLamp:16:3: error: 'GP' was not declared in this scope; did you mean 'GPC'?
SmartLamp:25:3: error: expected primary-expression before ')' token
C:\Users\Вульф\OneDrive\Документы\Arduino\SmartLamp\SmartLamp.ino: In function 'void setup()':
SmartLamp:54:6: error: 'class GyverPortal' has no member named 'attach'
exit status 1
'GP' was not declared in this scope; did you mean 'GPC'?
Код писался по коду с гитхаба с
этого примера