diff --git a/Follow_the_line/Programs /Read_sensor_values.py b/Follow_the_line/Programs /Read_sensor_values.py index f5a9785..734463b 100644 --- a/Follow_the_line/Programs /Read_sensor_values.py +++ b/Follow_the_line/Programs /Read_sensor_values.py @@ -1,21 +1,21 @@ -#!/usr/bin/env python3 -# Version 1.0 from 02/08/23 -from time import sleep -import ev3dev2 as ev3 -from ev3dev2.sensor import INPUT_1,INPUT_2,INPUT_3,INPUT_4 -from ev3dev2.sensor.lego import ColorSensor - -# Define the sensor inputs of the robot -cs_right = ColorSensor(INPUT_4) -cs_left = ColorSensor(INPUT_2) - -while True: - # printing the values of the right colour sensor - print('Right-Sensor: ','Intensity=', cs_right.reflected_light_intensity,' Color=',cs_right.color) - - # printing the values of the left colour sensor - print('Left-Sensor: ','Intensity=', cs_left.reflected_light_intensity,' Color=',cs_left.color) - - sleep(1) #the values are printed every second - +#!/usr/bin/env python3 + +from time import sleep +import ev3dev2 as ev3 +from ev3dev2.sensor import INPUT_1,INPUT_2,INPUT_3,INPUT_4 +from ev3dev2.sensor.lego import ColorSensor + +# Define the sensor inputs of the robot +cs_right = ColorSensor(INPUT_4) +cs_left = ColorSensor(INPUT_2) + +while True: + # printing the values of the right colour sensor + print('Right-Sensor: ','Intensity=', cs_right.reflected_light_intensity,' Color=',cs_right.color) + + # printing the values of the left colour sensor + print('Left-Sensor: ','Intensity=', cs_left.reflected_light_intensity,' Color=',cs_left.color) + + sleep(1) #the values are printed every second + \ No newline at end of file