troubleshooting display

fix attempt on upside down display and bad flicker
This commit is contained in:
Chuck
2025-04-07 20:34:14 -05:00
parent 62dc11bed1
commit 635ce7a88e
2 changed files with 7 additions and 18 deletions

View File

@@ -8,28 +8,27 @@
"display": {
"hardware": {
"rows": 32,
"cols": 64,
"cols": 32,
"chain_length": 2,
"parallel": 1,
"brightness": 50,
"hardware_mapping": "adafruit-hat-pwm",
"scan_mode": "progressive",
"pwm_bits": 11,
"pwm_dither_bits": 0,
"pwm_dither_bits": 2,
"pwm_lsb_nanoseconds": 130,
"led_rgb_sequence": "RGB",
"pixel_mapper_config": "U-mapper",
"panel_type": "",
"pixel_mapper_config": "U-mapper;Rotate:180",
"panel_type": "FM6126A",
"row_addr_type": 0,
"multiplexing": 0,
"disable_hardware_pulsing": true,
"inverse_colors": false,
"show_refresh_rate": false,
"limit_refresh_rate_hz": 100,
"rotation": 180
"limit_refresh_rate_hz": 120
},
"runtime": {
"gpio_slowdown": 2
"gpio_slowdown": 4
},
"rotation_interval": 10
},

View File

@@ -66,17 +66,7 @@ class DisplayManager:
logger.info("Display rotation set to: %d degrees", self.rotation)
def _draw_text(self, text, x, y, font, color=(255, 255, 255)):
"""Draw text on the canvas with optional rotation."""
if self.rotation == 180:
# For 180 degree rotation, flip coordinates
width = self.matrix.width
height = self.matrix.height
# Get text size for proper positioning
text_width, text_height = font.getsize(text)
# Adjust coordinates for rotation
x = width - x - text_width
y = height - y - text_height
"""Draw text on the canvas."""
self.draw.text((x, y), text, font=font, fill=color)
self.matrix.SetImage(self.image)