2024-12-25 21:57:57 -06:00
|
|
|
#include "Base_Robot.h"
|
|
|
|
#include "Sensor_TCRT5000.h"
|
|
|
|
class Robot_Seguidor
|
|
|
|
{
|
2024-12-25 22:30:22 -06:00
|
|
|
private:
|
|
|
|
Base_Robot Robot;
|
|
|
|
Sensor Sensor_1;
|
|
|
|
Sensor Sensor_2;
|
|
|
|
Sensor Sensor_3;
|
|
|
|
Sensor Sensor_4;
|
|
|
|
Sensor Sensor_5;
|
|
|
|
int sensor[5];
|
|
|
|
float Error=0, P=0, I=0, D=0, PID=0;
|
|
|
|
float Error_Anterior=0, Anteriror_I=0;
|
2024-12-25 21:57:57 -06:00
|
|
|
|
2024-12-25 22:30:22 -06:00
|
|
|
public:
|
|
|
|
Robot_Seguidor(int Pin_Motor_1A,
|
|
|
|
int IN1,
|
|
|
|
int IN2,
|
|
|
|
int ENA,
|
|
|
|
int IN3,
|
|
|
|
int IN4,
|
|
|
|
int ENB,
|
|
|
|
int PinS1,
|
|
|
|
int PinS2,
|
|
|
|
int PinS3,
|
|
|
|
int PinS4,
|
|
|
|
int PinS5)
|
|
|
|
:Robot(IN1, IN2, ENA, IN3, IN4, ENB),
|
|
|
|
Sensor_1(PinS1),
|
|
|
|
Sensor_2(PinS2),
|
|
|
|
Sensor_3(PinS3),
|
|
|
|
Sensor_4(PinS4),
|
|
|
|
Sensor_5(PinS5){}
|
|
|
|
void Inicializar();
|
|
|
|
void Lectura_de_sensores();
|
|
|
|
void Modo_Seguidor(int kP,int KI,int KD,int Velocidad);
|
2024-12-25 22:29:08 -06:00
|
|
|
};
|