Lu-Hsuan Chen
/
autocar_3sensor_mbed
An auto car with 3 IR sensors.
Diff: autocar/autocar.h
- Revision:
- 21:093c8525349a
- Parent:
- 19:d06f5a3ed0bc
diff -r cc12f841a06e -r 093c8525349a autocar/autocar.h --- a/autocar/autocar.h Thu Jul 19 07:26:27 2018 +0000 +++ b/autocar/autocar.h Thu Jul 19 07:41:10 2018 +0000 @@ -25,6 +25,7 @@ void readIR(bool* left, bool* middle, bool* right, int threshold); int readIRValues(); void readSensor(bool* left, bool* middle, bool* right, bool* hasObstacle, int threshold, int range); +void readSensorValues(int *values, bool *hasObstacle, int range); long map(long x, long in_min, long in_max, long out_min, long out_max); @@ -33,6 +34,7 @@ void driveMotor(bool left, bool middle, bool right); void driveMotor(bool left, bool middle, bool right, bool hasObstacle); void driveMotorPID(int values, float Kp, float Ki, float Kd); +void run(int values, float Kp, float Ki, float Kd, bool hasObstacle); void init(); void stop();