From 38e98e4dab99ddc7c28bb051cc04716c09f10ddb Mon Sep 17 00:00:00 2001 From: Tanja Sukal Date: Tue, 10 Sep 2024 12:33:43 +0000 Subject: [PATCH] Update 'Follow_the_line/Programs /Follow_line_color_recognition.py' --- Follow_the_line/Programs /Follow_line_color_recognition.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Follow_the_line/Programs /Follow_line_color_recognition.py b/Follow_the_line/Programs /Follow_line_color_recognition.py index 1a72433..bf6aff8 100644 --- a/Follow_the_line/Programs /Follow_line_color_recognition.py +++ b/Follow_the_line/Programs /Follow_line_color_recognition.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 - +# Version 1.2 from 02/08/23 from time import sleep import ev3dev2 as ev3 from ev3dev2.motor import Motor, SpeedPercent, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D @@ -27,10 +27,10 @@ speed_percent_both = 30 # speed percentage when both motors rotate (should be le # while-loop: the robot drives as long as the programm is not stopped while True: - # if-functions: for different actions when the Colorsensors detect the defined line-color + # if-functions: for different actions when the color sensors detect the defined line-color # after every function is a sleep set because it is enough to give the motors signals every 100 ms - # when the colorsensors detect black the function: .color is equal to 1 (one) + # when the color sensors detect black the function: .color is equal to 1 (one) if cs_right.color == line_color and cs_left.color != line_color: #if the right coloursensor detects the defined line-color, the robot drives faster to the right leds.set_color("LEFT", "GREEN") # the left led lights green leds.set_color("RIGHT", "AMBER") # the right led (side which detected black) lights amber