亮度调节功能完善
This commit is contained in:
parent
86ffd82ffe
commit
37c95722c8
File diff suppressed because one or more lines are too long
@ -7319,6 +7319,7 @@
|
||||
{
|
||||
"nid": 1040,
|
||||
"strtype": "SLIDER/Value",
|
||||
"integer": 7192,
|
||||
"InheritedType": 6
|
||||
},
|
||||
{
|
||||
@ -16284,6 +16285,77 @@
|
||||
"strtype": "STARTEVENTS/Name",
|
||||
"strval": "___initial_actions0",
|
||||
"InheritedType": 10
|
||||
},
|
||||
{
|
||||
"disabled": false,
|
||||
"nid": 1000172,
|
||||
"strtype": "_event/EventHandler",
|
||||
"strval": "SCREEN_LOAD_START",
|
||||
"childs": [
|
||||
{
|
||||
"nid": 1000173,
|
||||
"strtype": "_event/name",
|
||||
"strval": "Event17",
|
||||
"InheritedType": 10
|
||||
},
|
||||
{
|
||||
"nid": 1000174,
|
||||
"strtype": "_event/condition_C",
|
||||
"strval": "",
|
||||
"InheritedType": 10
|
||||
},
|
||||
{
|
||||
"nid": 1000175,
|
||||
"strtype": "_event/condition_P",
|
||||
"strval": "",
|
||||
"InheritedType": 10
|
||||
},
|
||||
{
|
||||
"nid": 1000176,
|
||||
"strtype": "_event/action",
|
||||
"strval": "INCREMENT SLIDER",
|
||||
"childs": [
|
||||
{
|
||||
"nid": 1000177,
|
||||
"strtype": "INCREMENT SLIDER/Name",
|
||||
"strval": "INCREMENT SLIDER",
|
||||
"InheritedType": 10
|
||||
},
|
||||
{
|
||||
"nid": 1000178,
|
||||
"strtype": "INCREMENT SLIDER/Call",
|
||||
"strval": "IncrementSlider( <{Target}>, <{Value}>, lv.ANIM.<{Animate}> )",
|
||||
"InheritedType": 10
|
||||
},
|
||||
{
|
||||
"nid": 1000179,
|
||||
"strtype": "INCREMENT SLIDER/CallC",
|
||||
"strval": "_ui_slider_increment( <{Target}>, <{Value}>, LV_ANIM_<{Animate}>);",
|
||||
"InheritedType": 10
|
||||
},
|
||||
{
|
||||
"nid": 1000180,
|
||||
"strtype": "INCREMENT SLIDER/Target",
|
||||
"strval": "GUID25017162-502774S17848463",
|
||||
"InheritedType": 9
|
||||
},
|
||||
{
|
||||
"nid": 1000181,
|
||||
"strtype": "INCREMENT SLIDER/Value",
|
||||
"integer": 1,
|
||||
"InheritedType": 6
|
||||
},
|
||||
{
|
||||
"nid": 1000182,
|
||||
"strtype": "INCREMENT SLIDER/Animate",
|
||||
"strval": "ON",
|
||||
"InheritedType": 3
|
||||
}
|
||||
],
|
||||
"InheritedType": 10
|
||||
}
|
||||
],
|
||||
"InheritedType": 4
|
||||
}
|
||||
],
|
||||
"saved_objtypeKey": "STARTEVENTS"
|
||||
@ -16317,7 +16389,7 @@
|
||||
"uiExportFolderPath": "D:\\yuwell_workspace\\FluxDC\\SquareLineProj\\Export",
|
||||
"projectExportFolderPath": "D:\\yuwell_workspace\\FluxDC\\SquareLineProj\\Export",
|
||||
"custom_variable_prefix": "uic",
|
||||
"backup_cnt": 220,
|
||||
"backup_cnt": 223,
|
||||
"autosave_cnt": 0,
|
||||
"group_color_cnt": 0,
|
||||
"lvgl_version": "8.3.6",
|
||||
@ -16334,7 +16406,7 @@
|
||||
"drive_fatfs_path": "",
|
||||
"naming": "_Screen_Name",
|
||||
"naming_force_lowercase": false,
|
||||
"nidcnt": 1000172,
|
||||
"nidcnt": 1000183,
|
||||
"BitDepth": 16,
|
||||
"Name": "ESP32S3_UI"
|
||||
}
|
||||
|
||||
@ -134,7 +134,8 @@ void ui_settings_screen_init(void)
|
||||
lv_obj_set_style_text_font(ui_settings_dianchi3, &ui_font_MiSansN, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
ui_settings_lightSlider = lv_slider_create(ui_settings_Time2);
|
||||
lv_slider_set_value(ui_settings_lightSlider, 0, LV_ANIM_OFF);
|
||||
lv_slider_set_range(ui_settings_lightSlider, 0, 8192);
|
||||
lv_slider_set_value(ui_settings_lightSlider, 7192, LV_ANIM_OFF);
|
||||
if(lv_slider_get_mode(ui_settings_lightSlider) == LV_SLIDER_MODE_RANGE) lv_slider_set_left_value(
|
||||
ui_settings_lightSlider, 0, LV_ANIM_OFF);
|
||||
lv_obj_set_width(ui_settings_lightSlider, 211);
|
||||
|
||||
@ -144,6 +144,7 @@ lv_obj_t * ui_debugmode_Label26;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
// EVENTS
|
||||
void ui_event____initial_actions0(lv_event_t * e);
|
||||
lv_obj_t * ui____initial_actions0;
|
||||
|
||||
// IMAGES AND IMAGE SETS
|
||||
@ -348,6 +349,15 @@ void ui_event_debugmode_Button6(lv_event_t * e)
|
||||
}
|
||||
}
|
||||
|
||||
void ui_event____initial_actions0(lv_event_t * e)
|
||||
{
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if(event_code == LV_EVENT_SCREEN_LOAD_START) {
|
||||
_ui_slider_increment(ui_settings_lightSlider, 1, LV_ANIM_ON);
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////// SCREENS ////////////////////
|
||||
|
||||
void ui_init(void)
|
||||
@ -362,5 +372,8 @@ void ui_init(void)
|
||||
ui_DeviceInfo_screen_init();
|
||||
ui_debugmode_screen_init();
|
||||
ui____initial_actions0 = lv_obj_create(NULL);
|
||||
lv_obj_add_event_cb(ui____initial_actions0, ui_event____initial_actions0, LV_EVENT_ALL, NULL);
|
||||
|
||||
lv_disp_load_scr(ui____initial_actions0);
|
||||
lv_disp_load_scr(ui_Home);
|
||||
}
|
||||
|
||||
@ -153,6 +153,7 @@ extern lv_obj_t * ui_debugmode_Label26;
|
||||
|
||||
// EVENTS
|
||||
|
||||
void ui_event____initial_actions0(lv_event_t * e);
|
||||
extern lv_obj_t * ui____initial_actions0;
|
||||
|
||||
// IMAGES AND IMAGE SETS
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -23,7 +23,6 @@ fonts/ui_font_MiSansN.c
|
||||
fonts/ui_font_MiSansN14.c
|
||||
fonts/ui_font_symbols16.c
|
||||
fonts/ui_font_symbolsalibaba.c
|
||||
|
||||
)
|
||||
|
||||
idf_component_register(SRCS ${SOURCES}
|
||||
|
||||
@ -134,7 +134,8 @@ void ui_settings_screen_init(void)
|
||||
lv_obj_set_style_text_font(ui_settings_dianchi3, &ui_font_MiSansN, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
ui_settings_lightSlider = lv_slider_create(ui_settings_Time2);
|
||||
lv_slider_set_value(ui_settings_lightSlider, 0, LV_ANIM_OFF);
|
||||
lv_slider_set_range(ui_settings_lightSlider, 0, 8192);
|
||||
lv_slider_set_value(ui_settings_lightSlider, 7192, LV_ANIM_OFF);
|
||||
if(lv_slider_get_mode(ui_settings_lightSlider) == LV_SLIDER_MODE_RANGE) lv_slider_set_left_value(
|
||||
ui_settings_lightSlider, 0, LV_ANIM_OFF);
|
||||
lv_obj_set_width(ui_settings_lightSlider, 211);
|
||||
|
||||
@ -144,6 +144,7 @@ lv_obj_t * ui_debugmode_Label26;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
// EVENTS
|
||||
void ui_event____initial_actions0(lv_event_t * e);
|
||||
lv_obj_t * ui____initial_actions0;
|
||||
|
||||
// IMAGES AND IMAGE SETS
|
||||
@ -348,6 +349,15 @@ void ui_event_debugmode_Button6(lv_event_t * e)
|
||||
}
|
||||
}
|
||||
|
||||
void ui_event____initial_actions0(lv_event_t * e)
|
||||
{
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
|
||||
if(event_code == LV_EVENT_SCREEN_LOAD_START) {
|
||||
_ui_slider_increment(ui_settings_lightSlider, 1, LV_ANIM_ON);
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////// SCREENS ////////////////////
|
||||
|
||||
void ui_init(void)
|
||||
@ -362,5 +372,8 @@ void ui_init(void)
|
||||
ui_DeviceInfo_screen_init();
|
||||
ui_debugmode_screen_init();
|
||||
ui____initial_actions0 = lv_obj_create(NULL);
|
||||
lv_obj_add_event_cb(ui____initial_actions0, ui_event____initial_actions0, LV_EVENT_ALL, NULL);
|
||||
|
||||
lv_disp_load_scr(ui____initial_actions0);
|
||||
lv_disp_load_scr(ui_Home);
|
||||
}
|
||||
|
||||
@ -153,6 +153,7 @@ extern lv_obj_t * ui_debugmode_Label26;
|
||||
|
||||
// EVENTS
|
||||
|
||||
void ui_event____initial_actions0(lv_event_t * e);
|
||||
extern lv_obj_t * ui____initial_actions0;
|
||||
|
||||
// IMAGES AND IMAGE SETS
|
||||
|
||||
@ -8,6 +8,9 @@
|
||||
#include "esp_err.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
/*ÉèÖÃÁÁ¶È×îµÍÖµ*/
|
||||
#define LOWERST_LIGHT_LEVEL (7222)
|
||||
|
||||
void ReadSdCallFunc(lv_event_t * e)
|
||||
{
|
||||
// Your code here
|
||||
@ -28,16 +31,18 @@ void F3callbackFunc(lv_event_t * e)
|
||||
// Your code here
|
||||
}
|
||||
|
||||
|
||||
void lightSliderCallback(lv_event_t * e)
|
||||
{
|
||||
// Your code here
|
||||
uint32_t value = lv_slider_get_value(e->target);
|
||||
// Your code here
|
||||
uint32_t value = 8192-lv_slider_get_value(e->target);
|
||||
//ESP_LOGI("lightSliderCallback", "value = %u", value);
|
||||
printf("value = %lu\n", value);
|
||||
// Set duty to 50%
|
||||
if (value>LOWERST_LIGHT_LEVEL)
|
||||
{
|
||||
value = LOWERST_LIGHT_LEVEL;
|
||||
}
|
||||
|
||||
ESP_ERROR_CHECK(ledc_set_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0, value));
|
||||
// Update duty to apply the new value
|
||||
ESP_ERROR_CHECK(ledc_update_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0));
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user