Update cardputer.yaml

improved pwm backlight, fixed temp readout to drop precision past decimal
This commit is contained in:
void 2025-04-02 18:21:36 +00:00
parent c46b388716
commit 462962f459
1 changed files with 13 additions and 14 deletions

View File

@ -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<int>(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"