change state to be correct

This commit is contained in:
reaw55 2023-12-27 00:46:19 +07:00
parent 4b781f0982
commit 55c6cf45cb
1 changed files with 24 additions and 24 deletions

View File

@ -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();
}