From 9a11c68ffc0290c456761abd4c435cd00d88c860 Mon Sep 17 00:00:00 2001 From: reaw55 <58457329+reaw55@users.noreply.github.com> Date: Wed, 27 Dec 2023 01:01:13 +0700 Subject: [PATCH] update ac code --- src/user_code.cpp | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/src/user_code.cpp b/src/user_code.cpp index f33e41c..82a79a2 100644 --- a/src/user_code.cpp +++ b/src/user_code.cpp @@ -340,22 +340,45 @@ void update_lcd_ac() { // Fan Speed 0: Auto, 1: High, 2: Mid, 3: Low uint8_t fan_speed = ac_get_fan_speed(); if(fan_speed == 0) { - fan.Set_background_image_pic(18); + //fan.Set_background_image_pic(18); + elcd_send_stop_bit(); + elcd.print("fan.pic=18"); + elcd_send_stop_bit(); } else if(fan_speed == 1) { - fan.Set_background_image_pic(19); + //fan.Set_background_image_pic(19); + elcd_send_stop_bit(); + elcd.print("fan.pic=19"); + elcd_send_stop_bit(); } else if(fan_speed == 2) { - fan.Set_background_image_pic(21); + //fan.Set_background_image_pic(21); + elcd_send_stop_bit(); + elcd.print("fan.pic=21"); + elcd_send_stop_bit(); } else if(fan_speed == 3) { - fan.Set_background_image_pic(20); + //fan.Set_background_image_pic(20); + elcd_send_stop_bit(); + elcd.print("fan.pic=20"); + elcd_send_stop_bit(); } else { - fan.Set_background_image_pic(18); + //fan.Set_background_image_pic(18); + elcd_send_stop_bit(); + elcd.print("fan.pic=18"); + elcd_send_stop_bit(); } //update the mode cool is 22, fan mode is 24, for off the toggle button act as indicator //Mode 0: Off, 1: Cool, 2: Fan uint8_t mode_state = ac_get_mode(); - mode.Set_background_image_pic(mode_state==1?22:24); + //mode.Set_background_image_pic(mode_state==1?22:24); + elcd_send_stop_bit(); + elcd.print("mode.pic="); + elcd.print(mode_state==1?22:24); + elcd_send_stop_bit(); //update the ac toggle button - ac_toggle.Set_background_image_pic(ac_get_mode()==0?1:2); + //ac_toggle.Set_background_image_pic(ac_get_mode()==0?1:2); + elcd_send_stop_bit(); + elcd.print("ac_toggle.pic="); + elcd.print(ac_get_mode()==0?1:2); + elcd_send_stop_bit(); } @@ -400,7 +423,7 @@ void timer_tick_callback() } void ac_changed_user_callback(int mode, int temperature, int fan_speed) { - + update_lcd_ac() } void mqtt_connected_user_callback() {