Tested Line Following with different track shape

This commit is contained in:
Tanja Sukal 2023-09-25 17:35:52 +02:00
parent 3db1a54419
commit be642d6857

View File

@ -41,12 +41,12 @@ while True:
m_l_speed_percent= max_speed_percent*cs_l_percent m_l_speed_percent= max_speed_percent*cs_l_percent
m_r_speed_percent= max_speed_percent*cs_r_percent m_r_speed_percent= max_speed_percent*cs_r_percent
# make sure percentage is not higher than possible (100%) and signal it through lights # make sure percentage is not higher than possible (100%) and signal it through lights
if m_l_speed_percent >= 100: if m_l_speed_percent > 100:
m_l_speed_percent = 0 m_l_speed_percent = 0
leds.set_color("LEFT", "AMBER") leds.set_color("LEFT", "AMBER")
else: else:
leds.set_color("LEFT", "GREEN") leds.set_color("LEFT", "GREEN")
if m_r_speed_percent >= 100: if m_r_speed_percent > 100:
m_r_speed_percent = 0 m_r_speed_percent = 0
leds.set_color("RIGHT", "AMBER") leds.set_color("RIGHT", "AMBER")
else: else: