motorSpeed = 50 if (left and (not right)): Go_Forward_Left(turnSpeed, motorSpeed) elif ((not left) and right): Go_Forward_Right(turnSpeed, motorSpeed) elif ((not left) and (not right)): print("[-] No line found") StopMortors() else: Go_Forward_Straight(turnSpeed, motorSpeed) ## ================================================================== ## ==================== Object Detection Chocice ==================== if input_str == "o": #print (">>>>>>>>>> Straight with Object detection <<<<<<<<<<") #Forward(70) DriveWithObjectDetection(dist) GPIO.CleanUp() # Reset by Pressing CTRL + C except KeyboardInterrupt: print("Measurement stopped by the user") GPIO.cleanup()