Skip to content

Commit 1214619

Browse files
committed
ref RobertLucian#8 : hotfix - cured some syntax errors
1 parent dadd967 commit 1214619

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Software/Python/line_follower/line_sensor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,15 @@ def read_sensor():
134134

135135
for step in range(5):
136136
# calculate the 16-bit number we got
137-
sensor_buffer[i].append(bytes_list[2 * step] * 256 + bytes_list[2 * step + 1])
137+
sensor_buffer[step].append(bytes_list[2 * step] * 256 + bytes_list[2 * step + 1])
138138

139139
# if there're too many elements in the list
140140
# then remove one
141-
if len(sensor_buffer[i]) > max_buffer_length:
142-
sensor_buffer[i].pop(0)
141+
if len(sensor_buffer[step]) > max_buffer_length:
142+
sensor_buffer[step].pop(0)
143143

144144
# eliminate outlier values and select the most recent one
145-
filtered_value = statisticalNoiseReduction(sensor_buffer[i], 2)[-1]
145+
filtered_value = statisticalNoiseReduction(sensor_buffer[step], 2)[-1]
146146

147147
# append the value to the corresponding IR sensor
148148
output_values.append(filtered_value)

0 commit comments

Comments
 (0)