Lu-Hsuan Chen
/
autocar_3sensor_mbed
An auto car with 3 IR sensors.
Diff: main.cpp
- Revision:
- 21:093c8525349a
- Parent:
- 20:cc12f841a06e
diff -r cc12f841a06e -r 093c8525349a main.cpp --- a/main.cpp Thu Jul 19 07:26:27 2018 +0000 +++ b/main.cpp Thu Jul 19 07:41:10 2018 +0000 @@ -66,11 +66,13 @@ // on track (black): < 500 //readIR(&left, &middle, &right, threshold); //readSensor(&left, &middle, &right, &hasObstacle, threshold, range); - values = readIRValues(); // read IR values + //values = readIRValues(); // read IR values + readSensorValues(&values, &hasObstacle, range); //driveMotor(left, middle, right); //driveMotor(left, middle, right, hasObstacle); - driveMotorPID(values, Kp, Ki, Kd); + //driveMotorPID(values, Kp, Ki, Kd); + run(values, Kp, Ki, Kd, hasObstacle); } } }