From 45e7944f7fe28b9d501f071c68a5c10e6623f188 Mon Sep 17 00:00:00 2001 From: Attila Farago Date: Tue, 23 Jul 2024 14:35:33 +0200 Subject: [PATCH] pybricks.common.LightMatrix.char: Improve single digits. --- CHANGELOG.md | 7 ++- pybricks/common/pb_type_lightmatrix_fonts.c | 64 ++++++++++----------- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d1ad4562..0928b791d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,6 @@ correction of the `hub.imu.heading()` value ([support#1678]). - Added `update_heading_correction` to interactively set the heading correction value ([support#1678]). -- Reduced hub poweroff time from 3 to 2 second to make it easier to turn off - the hub ([pybricks-micropython#250]). ### Changed @@ -22,8 +20,13 @@ be erased. This avoids issues with incompatible program files ([support#1622]). - The `angular_velocity_threshold`, and `acceleration_threshold` settings in `hub.imu.settings` are now persistent between reboots. +- Reduced hub poweroff time from 3 to 2 second to make it easier to turn off + the hub ([pybricks-micropython#250]). +- Improved font for the digits ``0--9`` when displaying them + with `hub.display.char(str(x))` ([pybricks-micropython#253]). [pybricks-micropython#250]: https://github.com/pybricks/pybricks-micropython/pull/250 +[pybricks-micropython#253]: https://github.com/pybricks/pybricks-micropython/pull/253 [support#1615]: https://github.com/pybricks/support/issues/1615 [support#1622]: https://github.com/pybricks/support/issues/1622 [support#1678]: https://github.com/pybricks/support/issues/1678 diff --git a/pybricks/common/pb_type_lightmatrix_fonts.c b/pybricks/common/pb_type_lightmatrix_fonts.c index 60d4ac5a4..560dc1c7d 100644 --- a/pybricks/common/pb_type_lightmatrix_fonts.c +++ b/pybricks/common/pb_type_lightmatrix_fonts.c @@ -196,11 +196,11 @@ const uint8_t pb_font_5x5[95][5] = { 0b10000, // 🟨⬛⬛⬛⬛ }, { // 0 - 0b01100, // ⬛🟨🟨⬛⬛ - 0b10010, // 🟨⬛⬛🟨⬛ - 0b10010, // 🟨⬛⬛🟨⬛ - 0b10010, // 🟨⬛⬛🟨⬛ - 0b01100, // ⬛🟨🟨⬛⬛ + 0b01110, // ⬛🟨🟨🟨⬛ + 0b01010, // ⬛🟨⬛🟨⬛ + 0b01010, // ⬛🟨⬛🟨⬛ + 0b01010, // ⬛🟨⬛🟨⬛ + 0b01110, // ⬛🟨🟨🟨⬛ }, { // 1 0b00100, // ⬛⬛🟨⬛⬛ @@ -210,60 +210,60 @@ const uint8_t pb_font_5x5[95][5] = { 0b01110, // ⬛🟨🟨🟨⬛ }, { // 2 - 0b11100, // 🟨🟨🟨⬛⬛ + 0b01110, // ⬛🟨🟨🟨⬛ 0b00010, // ⬛⬛⬛🟨⬛ - 0b01100, // ⬛🟨🟨⬛⬛ - 0b10000, // 🟨⬛⬛⬛⬛ - 0b11110, // 🟨🟨🟨🟨⬛ + 0b01110, // ⬛🟨🟨🟨⬛ + 0b01000, // ⬛🟨⬛⬛⬛ + 0b01110, // ⬛🟨🟨🟨⬛ }, { // 3 - 0b11110, // 🟨🟨🟨🟨⬛ + 0b01110, // ⬛🟨🟨🟨⬛ 0b00010, // ⬛⬛⬛🟨⬛ - 0b00100, // ⬛⬛🟨⬛⬛ - 0b10010, // 🟨⬛⬛🟨⬛ - 0b01100, // ⬛🟨🟨⬛⬛ + 0b01110, // ⬛🟨🟨🟨⬛ + 0b00010, // ⬛⬛⬛🟨⬛ + 0b01110, // ⬛🟨🟨🟨⬛ }, { // 4 - 0b00110, // ⬛⬛🟨🟨⬛ 0b01010, // ⬛🟨⬛🟨⬛ - 0b10010, // 🟨⬛⬛🟨⬛ - 0b11111, // 🟨🟨🟨🟨🟨 + 0b01010, // ⬛🟨⬛🟨⬛ + 0b01110, // ⬛🟨🟨🟨⬛ + 0b00010, // ⬛⬛⬛🟨⬛ 0b00010, // ⬛⬛⬛🟨⬛ }, { // 5 - 0b11111, // 🟨🟨🟨🟨🟨 - 0b10000, // 🟨⬛⬛⬛⬛ - 0b11110, // 🟨🟨🟨🟨⬛ - 0b00001, // ⬛⬛⬛⬛🟨 - 0b11110, // 🟨🟨🟨🟨⬛ + 0b01110, // ⬛🟨🟨🟨⬛ + 0b01000, // ⬛🟨⬛⬛⬛ + 0b01110, // ⬛🟨🟨🟨⬛ + 0b00010, // ⬛⬛⬛🟨⬛ + 0b01110, // ⬛🟨🟨🟨⬛ }, { // 6 - 0b00010, // ⬛⬛⬛🟨⬛ - 0b00100, // ⬛⬛🟨⬛⬛ 0b01110, // ⬛🟨🟨🟨⬛ - 0b10001, // 🟨⬛⬛⬛🟨 + 0b01000, // ⬛🟨⬛⬛⬛ + 0b01110, // ⬛🟨🟨🟨⬛ + 0b01010, // ⬛🟨⬛🟨⬛ 0b01110, // ⬛🟨🟨🟨⬛ }, { // 7 - 0b11111, // 🟨🟨🟨🟨🟨 + 0b01110, // ⬛🟨🟨🟨⬛ 0b00010, // ⬛⬛⬛🟨⬛ 0b00100, // ⬛⬛🟨⬛⬛ - 0b01000, // ⬛🟨⬛⬛⬛ - 0b10000, // 🟨⬛⬛⬛⬛ + 0b00100, // ⬛⬛🟨⬛⬛ + 0b00100, // ⬛⬛🟨⬛⬛ }, { // 8 0b01110, // ⬛🟨🟨🟨⬛ - 0b10001, // 🟨⬛⬛⬛🟨 + 0b01010, // ⬛🟨⬛🟨⬛ 0b01110, // ⬛🟨🟨🟨⬛ - 0b10001, // 🟨⬛⬛⬛🟨 + 0b01010, // ⬛🟨⬛🟨⬛ 0b01110, // ⬛🟨🟨🟨⬛ }, { // 9 0b01110, // ⬛🟨🟨🟨⬛ - 0b10001, // 🟨⬛⬛⬛🟨 + 0b01010, // ⬛🟨⬛🟨⬛ + 0b01110, // ⬛🟨🟨🟨⬛ + 0b00010, // ⬛⬛⬛🟨⬛ 0b01110, // ⬛🟨🟨🟨⬛ - 0b00100, // ⬛⬛🟨⬛⬛ - 0b01000, // ⬛🟨⬛⬛⬛ }, { // : 0b00000, // ⬛⬛⬛⬛⬛