Add further testing code for rotary encoder and lcd
This commit is contained in:
@@ -224,6 +224,8 @@ int main()
|
||||
pid_init(&pid, 0.1, 0.1, 4.0, 0.0, 100.0, 40.0, 0.25);
|
||||
pid_zero(&pid);
|
||||
|
||||
snprintf(&disp[2][0], 17, " \xBC\xCF\xAF\xC0 Reflow");
|
||||
|
||||
while (1) {
|
||||
sd_card_mounted = mount_sd_card_if_avail(sd_card_mounted);
|
||||
|
||||
@@ -249,7 +251,7 @@ int main()
|
||||
else
|
||||
led_set(0, 0);
|
||||
|
||||
snprintf(&disp[3][0], 17, "Temp: %s%.1f C", (temp_status == 0 ? "" : temp_status < 0 ? "<" : ">")
|
||||
snprintf(&disp[3][0], 17, "Temp: %s%.1f ""\xDF""C", (temp_status == 0 ? "" : temp_status < 0 ? "<" : ">")
|
||||
, current_temp);
|
||||
}
|
||||
|
||||
@@ -266,14 +268,21 @@ int main()
|
||||
}
|
||||
|
||||
button = button_read_event();
|
||||
|
||||
if (button == BUTTON_SHORT_RELEASED) {
|
||||
rotary_encoder_zero();
|
||||
} else if (button == BUTTON_LONG_RELEASED) {
|
||||
adc_pt1000_clear_error();
|
||||
}
|
||||
|
||||
|
||||
rot = rotary_encoder_get_abs_val();
|
||||
|
||||
oven_driver_set_power(rot > 100U ? 100U : rot);
|
||||
|
||||
|
||||
/* TODO: handle gui */
|
||||
snprintf(&disp[1][0], 17, "Rotary: %u", (unsigned int)rot);
|
||||
snprintf(&disp[2][0], 17, "Button: %s", (button == BUTTON_SHORT ? "SHORT" : (button == BUTTON_LONG ? "LONG" : "")));
|
||||
snprintf(&disp[1][0], 17, "Rot: %u %s", (unsigned int)rot, (button == BUTTON_SHORT ? "SHORT" : (button == BUTTON_LONG ? "LONG" : "")));
|
||||
|
||||
handle_shell_uart_input(shell_handle);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user