From 462962f45908abce6f8b319b5e2ec832e96a411a Mon Sep 17 00:00:00 2001 From: void Date: Wed, 2 Apr 2025 18:21:36 +0000 Subject: [PATCH] Update cardputer.yaml improved pwm backlight, fixed temp readout to drop precision past decimal --- cardputer.yaml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/cardputer.yaml b/cardputer.yaml index da049bd..a8171d8 100644 --- a/cardputer.yaml +++ b/cardputer.yaml @@ -133,7 +133,7 @@ light: output: backlight_output # Link to the correct output component id: backlight restore_mode: RESTORE_AND_ON - gamma_correct: 2.8 + gamma_correct: 2 default_transition_length: 1s flash_transition_length: 0s disabled_by_default: False @@ -202,19 +202,18 @@ display: rotation: 90 invert_colors: true lambda: |- - it.image(47, 50, id(my_image)); - // Set background color to black for better contrast - Color text_color = id(color_white); // Set text color to white - // Display the current time - it.strftime(49, 70, id(roboto_20), text_color, TextAlign::BASELINE_LEFT, "%l:%M", id(sntp_time).now()); - it.print(49, 76, id(roboto_20), text_color, "Your slut is at:"); - it.print(49, 90, id(roboto_20), text_color, id(mom_state).state.c_str()); - // Display current weather condition - it.print(49, 104, id(roboto_20), id(weather_condition).state.c_str()); - // Display current temperature under the weather condition - String temp_str = "Temp: " + String(id(temperature).state) + " °F"; // Create the temperature string - it.print(49, 120, id(roboto_20), temp_str.c_str()); // Convert the String to a const char* and display it - + it.image(47, 50, id(my_image)); + // Set background color to black for better contrast + Color text_color = id(color_white); // Set text color to white + // Display the current time + it.strftime(49, 70, id(roboto_20), text_color, TextAlign::BASELINE_LEFT, "%l:%M", id(sntp_time).now()); + it.print(49, 76, id(roboto_20), text_color, "Your slut is at:"); + it.print(49, 90, id(roboto_20), text_color, id(mom_state).state.c_str()); + // Display current weather condition + it.print(49, 104, id(roboto_20), id(weather_condition).state.c_str()); + // Display current temperature under the weather condition + String temp_str = "Temp: " + String(static_cast(id(temperature).state)) + " °F"; // Truncate decimal + it.print(49, 120, id(roboto_20), temp_str.c_str()); // Convert the String to a const char* and display it font: - file: "gfonts://Roboto"