File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Software/Python/line_follower Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -142,32 +142,32 @@ def line_sensor_val_scratch():
142142 return 6
143143 else :
144144 return 7
145-
145+
146146def line_sensor_vals ():
147147 #if the line is in the middle, keep moving straight
148148 #if the line is slightly left of right, keep moving straight
149149 curr = absolute_line_pos ()
150150 if curr == small_r or curr == small_l or curr == mid or curr == mid1 :
151151 return '0'
152-
152+
153153 #If the line is towards the sligh left, turn slight right
154154 elif curr == small_l1 :
155155 return '-1'
156156 elif curr == left or curr == left1 :
157157 return '-2'
158-
158+
159159 #If the line is towards the sligh right, turn slight left
160160 elif curr == small_r1 :
161161 return '1'
162162 elif curr == right or curr == right1 :
163163 return '2'
164- elif curr == stop :
164+ elif curr == stop :
165165 return '3'
166166 else :
167167 return '4'
168-
169-
170- if __name__ == "__main__" :
168+
169+
170+ if __name__ == "__main__" :
171171 while True :
172- print line_sensor_vals ()
172+ print ( line_sensor_vals ())
173173 time .sleep (poll_time )
You can’t perform that action at this time.
0 commit comments