mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-11 21:33:00 +00:00
troubleshooting display
fix attempt on upside down display and bad flicker
This commit is contained in:
@@ -8,28 +8,27 @@
|
|||||||
"display": {
|
"display": {
|
||||||
"hardware": {
|
"hardware": {
|
||||||
"rows": 32,
|
"rows": 32,
|
||||||
"cols": 64,
|
"cols": 32,
|
||||||
"chain_length": 2,
|
"chain_length": 2,
|
||||||
"parallel": 1,
|
"parallel": 1,
|
||||||
"brightness": 50,
|
"brightness": 50,
|
||||||
"hardware_mapping": "adafruit-hat-pwm",
|
"hardware_mapping": "adafruit-hat-pwm",
|
||||||
"scan_mode": "progressive",
|
"scan_mode": "progressive",
|
||||||
"pwm_bits": 11,
|
"pwm_bits": 11,
|
||||||
"pwm_dither_bits": 0,
|
"pwm_dither_bits": 2,
|
||||||
"pwm_lsb_nanoseconds": 130,
|
"pwm_lsb_nanoseconds": 130,
|
||||||
"led_rgb_sequence": "RGB",
|
"led_rgb_sequence": "RGB",
|
||||||
"pixel_mapper_config": "U-mapper",
|
"pixel_mapper_config": "U-mapper;Rotate:180",
|
||||||
"panel_type": "",
|
"panel_type": "FM6126A",
|
||||||
"row_addr_type": 0,
|
"row_addr_type": 0,
|
||||||
"multiplexing": 0,
|
"multiplexing": 0,
|
||||||
"disable_hardware_pulsing": true,
|
"disable_hardware_pulsing": true,
|
||||||
"inverse_colors": false,
|
"inverse_colors": false,
|
||||||
"show_refresh_rate": false,
|
"show_refresh_rate": false,
|
||||||
"limit_refresh_rate_hz": 100,
|
"limit_refresh_rate_hz": 120
|
||||||
"rotation": 180
|
|
||||||
},
|
},
|
||||||
"runtime": {
|
"runtime": {
|
||||||
"gpio_slowdown": 2
|
"gpio_slowdown": 4
|
||||||
},
|
},
|
||||||
"rotation_interval": 10
|
"rotation_interval": 10
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -66,17 +66,7 @@ class DisplayManager:
|
|||||||
logger.info("Display rotation set to: %d degrees", self.rotation)
|
logger.info("Display rotation set to: %d degrees", self.rotation)
|
||||||
|
|
||||||
def _draw_text(self, text, x, y, font, color=(255, 255, 255)):
|
def _draw_text(self, text, x, y, font, color=(255, 255, 255)):
|
||||||
"""Draw text on the canvas with optional rotation."""
|
"""Draw text on the canvas."""
|
||||||
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
|
|
||||||
|
|
||||||
self.draw.text((x, y), text, font=font, fill=color)
|
self.draw.text((x, y), text, font=font, fill=color)
|
||||||
self.matrix.SetImage(self.image)
|
self.matrix.SetImage(self.image)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user