From 7118317a18e3024b341d14e72a9e741a7b14b2e5 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 6 Jun 2023 13:48:57 +0200 Subject: don't print uart messages constantly and fix for newly bent camera --- nicla/road.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'nicla/road.py') diff --git a/nicla/road.py b/nicla/road.py index c5ffae3..ceabc3b 100644 --- a/nicla/road.py +++ b/nicla/road.py @@ -11,11 +11,11 @@ clock = time.clock() WIDTH = 480 HEIGHT = 320 -HORIZON = 120 -STRETCH = 155 +HORIZON = 150 +STRETCH = 40 SQUEEZE = 400 -STEERING_ENTHOUSIASM = 7.0 +STEERING_ENTHOUSIASM = 3.0 ROAD_MIN_BRIGHTNESS = 0xa0 points = [(STRETCH, HORIZON), @@ -47,6 +47,7 @@ def main(): avg *= STEERING_ENTHOUSIASM avg = max(-1, min(1, avg)) + print(avg) steerByte = int((avg + 1.0) * (DUI_CMD_STEER_END - DUI_CMD_STEER_START) / 2 + DUI_CMD_STEER_START) uart.uart_buffer(steerByte) -- cgit v1.2.3