From 55c6cf45cb4ff888fd830a4692b84865826b7687 Mon Sep 17 00:00:00 2001 From: reaw55 <58457329+reaw55@users.noreply.github.com> Date: Wed, 27 Dec 2023 00:46:19 +0700 Subject: [PATCH] change state to be correct --- src/user_code.cpp | 48 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/user_code.cpp b/src/user_code.cpp index 431db5b..f27f99e 100644 --- a/src/user_code.cpp +++ b/src/user_code.cpp @@ -238,85 +238,85 @@ void virtual_interrupt_user_callback(int pin, int state) void update_lcd_row1() { bool master_state = row_is_on(ROW1_LIGHT1,ROW1_LIGHT2); - //row1_master.Set_background_image_pic(master_state?9:10); + //row1_master.Set_background_image_pic(master_state?10:9); elcd_send_stop_bit(); elcd.print("row1_master.pic="); - elcd.print(master_state?9:10); + elcd.print(master_state?10:)9; elcd_send_stop_bit(); bool lt1_state = pwm_get_state(ROW1_LIGHT1); bool lt2_state = pwm_get_state(ROW1_LIGHT2); //also update the light1 and light2 buttons background to reflect the current state - //row1_lv1.Set_background_image_pic(lt1_state?5:6); - //row1_lv2.Set_background_image_pic(lt2_state?7:8); + //row1_lv1.Set_background_image_pic(lt1_state?6:5); + //row1_lv2.Set_background_image_pic(lt2_state?8:7); elcd.print("row1_lv1.pic="); - elcd.print(lt1_state?5:6); + elcd.print(lt1_state?6:5); elcd_send_stop_bit(); elcd.print("row1_lv2.pic="); - elcd.print(lt2_state?7:8); + elcd.print(lt2_state?8:7); elcd_send_stop_bit(); } void update_lcd_row2() { bool master_state = row_is_on(ROW2_LIGHT1,ROW2_LIGHT2); - //row2_master.Set_background_image_pic(master_state?11:12); + //row2_master.Set_background_image_pic(master_state?12:11); elcd_send_stop_bit(); elcd.print("row2_master.pic="); - elcd.print(master_state?11:12); + elcd.print(master_state?12:11); elcd_send_stop_bit(); bool lt1_state = pwm_get_state(ROW2_LIGHT1); bool lt2_state = pwm_get_state(ROW2_LIGHT2); //also update the light1 and light2 buttons background to reflect the current state - //row2_lv1.Set_background_image_pic(lt1_state?5:6); - //row2_lv2.Set_background_image_pic(lt2_state?7:8); + //row2_lv1.Set_background_image_pic(lt1_state?6:5); + //row2_lv2.Set_background_image_pic(lt2_state?8:7); elcd.print("row2_lv1.pic="); - elcd.print(lt1_state?5:6); + elcd.print(lt1_state?6:5); elcd_send_stop_bit(); elcd.print("row2_lv2.pic="); - elcd.print(lt2_state?7:8); + elcd.print(lt2_state?8:7); elcd_send_stop_bit(); } void update_lcd_row3() { bool master_state = row_is_on(ROW3_LIGHT1,ROW3_LIGHT2); - //row3_master.Set_background_image_pic(master_state?13:14); + //row3_master.Set_background_image_pic(master_state?14:13); elcd_send_stop_bit(); elcd.print("row3_master.pic="); - elcd.print(master_state?13:14); + elcd.print(master_state?14:13); elcd_send_stop_bit(); bool lt1_state = pwm_get_state(ROW3_LIGHT1); bool lt2_state = pwm_get_state(ROW3_LIGHT2); //also update the light1 and light2 buttons background to reflect the current state - //row3_lv1.Set_background_image_pic(lt1_state?5:6); - //row3_lv2.Set_background_image_pic(lt2_state?7:8); + //row3_lv1.Set_background_image_pic(lt1_state?6:5); + //row3_lv2.Set_background_image_pic(lt2_state?8:7); elcd.print("row3_lv1.pic="); - elcd.print(lt1_state?5:6); + elcd.print(lt1_state?6:5); elcd_send_stop_bit(); elcd.print("row3_lv2.pic="); - elcd.print(lt2_state?7:8); + elcd.print(lt2_state?8:7); elcd_send_stop_bit(); } void update_lcd_row4() { bool master_state = row_is_on(ROW4_LIGHT1,ROW4_LIGHT2); - //row4_master.Set_background_image_pic(master_state?15:16); + //row4_master.Set_background_image_pic(master_state?16:15); elcd_send_stop_bit(); elcd.print("row4_master.pic="); - elcd.print(master_state?15:16); + elcd.print(master_state?16:15); elcd_send_stop_bit(); bool lt1_state = pwm_get_state(ROW4_LIGHT1); bool lt2_state = pwm_get_state(ROW4_LIGHT2); //also update the light1 and light2 buttons background to reflect the current state - //row4_lv1.Set_background_image_pic(lt1_state?5:6); - //row4_lv2.Set_background_image_pic(lt2_state?7:8); + //row4_lv1.Set_background_image_pic(lt1_state?6:5); + //row4_lv2.Set_background_image_pic(lt2_state?8:7); elcd.print("row4_lv1.pic="); - elcd.print(lt1_state?5:6); + elcd.print(lt1_state?6:5); elcd_send_stop_bit(); elcd.print("row4_lv2.pic="); - elcd.print(lt2_state?7:8); + elcd.print(lt2_state?8:7); elcd_send_stop_bit(); }