diff --git a/oving_3/main.py b/oving_3/main.py index e4b38bf..937fbff 100644 --- a/oving_3/main.py +++ b/oving_3/main.py @@ -39,7 +39,19 @@ leftMotor = Motor(port=Port.A) rightMotor = Motor(port=Port.B) - robotDriveBase = DriveBase(leftMotor, rightMotor, wheel_diameter=56, axle_track=110) -robotDriveBase.drive(1000, 0) \ No newline at end of file +startBtn = TouchSensor(port=Port.S1) +usSensor = UltrasonicSensor(port=Port.S3) + +leftColorSensor = ColorSensor(port=Port.S2) +rightColorSensor = ColorSensor(port=Port.S4) + +while True: + if leftColorSensor.color() == Color.BLACK: + robotDriveBase.turn(5) + + elif rightColorSensor.color() == Color.BLACK: + robotDriveBase.turn(-5) + + DriveBase.run(100) \ No newline at end of file