From 0e22ca0e961164c8b70d0b6e80e4f80da30e05f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20K=C3=BChnlein?= Date: Wed, 18 Nov 2026 14:53:32 +0100 Subject: [PATCH] tilt fix --- Moving_Head_Test/pan_tilt_advanced_control.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Moving_Head_Test/pan_tilt_advanced_control.py b/Moving_Head_Test/pan_tilt_advanced_control.py index 9bfdcba..7fb7ad5 100755 --- a/Moving_Head_Test/pan_tilt_advanced_control.py +++ b/Moving_Head_Test/pan_tilt_advanced_control.py @@ -470,10 +470,8 @@ def calculate_tilt( tilt_rad = math.atan2(-dy, dist_horiz) tilt_deg = math.degrees(tilt_rad) - # Korrigierte Skalierung: Multiplikator 127.5 für den vollen 270°-Bereich - tilt_dmx = 127.5 + (tilt_deg / (TILT_RANGE_DEG / 2.0)) * 127.5 - if ceiling_mode: - tilt_dmx = 255.0 - tilt_dmx + base_tilt = (255.0 - DEFAULT_TILT) if ceiling_mode else float(DEFAULT_TILT) + tilt_dmx = base_tilt + (tilt_deg / (TILT_RANGE_DEG / 2.0)) * 127.5 return round(max(0.0, min(255.0, tilt_dmx))) @@ -1181,9 +1179,9 @@ def main() -> None: elif key in (ord("r"), ord("c")): # Reset-Funktion: Pan/Tilt Default, Tracking Pausiert, Farben/Gobos bleiben dmx.set_pan(DEFAULT_PAN) - dmx.set_channel(2, 0) dmx.set_tilt(DEFAULT_TILT) - dmx.set_channel(2, 0) + dmx.set_channel(3, 0) # Pan Fine zurücksetzen + dmx.set_channel(4, 0) # Tilt Fine zurücksetzen filter_pan.reset(DEFAULT_PAN) filter_tilt.reset(DEFAULT_TILT) tracking_enabled = False