Update 'Follow_the_line/Programs /Follow_line_color_recognition.py'
This commit is contained in:
parent
2fdc828608
commit
38e98e4dab
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
# Version 1.2 from 02/08/23
|
||||||
from time import sleep
|
from time import sleep
|
||||||
import ev3dev2 as ev3
|
import ev3dev2 as ev3
|
||||||
from ev3dev2.motor import Motor, SpeedPercent, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D
|
from ev3dev2.motor import Motor, SpeedPercent, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D
|
||||||
@ -27,7 +27,7 @@ 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-loop: the robot drives as long as the programm is not stopped
|
||||||
while True:
|
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
|
# after every function is a sleep set because it is enough to give the motors signals every 100 ms
|
||||||
|
|
||||||
# when the color sensors detect black the function: .color is equal to 1 (one)
|
# when the color sensors detect black the function: .color is equal to 1 (one)
|
||||||
|
Loading…
Reference in New Issue
Block a user