FluxDC/components/FluxUI/ui_events.c
2025-03-08 14:45:49 +08:00

61 lines
1.2 KiB
C
Raw Blame History

// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.5.1
// LVGL version: 8.3.6
// Project name: ESP32S3_UI
#include "ui.h"
#include "driver/ledc.h"
#include "esp_err.h"
#include "esp_log.h"
/*관벵Modbus꾸鱗쌈왯*/
#include "FluxMod.h"
/*<2A>零좋똑離됴令*/
#define LOWERST_LIGHT_LEVEL (7222)
void ReadSdCallFunc(lv_event_t * e)
{
// Your code here
}
void F1callbackFunc(lv_event_t * e)
{
// Your code here
}
void F2callbackFunc(lv_event_t * e)
{
// Your code here
}
void F3callbackFunc(lv_event_t * e)
{
// Your code here
}
void lightSliderCallback(lv_event_t * e)
{
// Your code here
// Your code here
uint32_t value = 8192-lv_slider_get_value(e->target);
//ESP_LOGI("lightSliderCallback", "value = %u", value);
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));
}
void DeviceDropDownValueChanged(lv_event_t * e)
{
char buf[32]={};
lv_dropdown_get_selected_str(e->target,buf,32);
lv_label_set_text(ui_Home_HeaderDeviceType, buf);
}