Skip to content

Commit 80ca03d

Browse files
committed
Añade Sketch de ejemplo
1 parent a260b61 commit 80ca03d

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
///////////////////////////////////////////////////////
2+
// Programa de ejemplo para la librería PIDfromBT.h //
3+
// //
4+
// APP: https://github.com/robotaleh/PIDfromBT //
5+
// Lib: https://github.com/robotaleh/PIDfromBTlib //
6+
// //
7+
// Creado por Alex Santos aka @robotaleh de OPRobots //
8+
///////////////////////////////////////////////////////
9+
10+
//Inclusión de librería
11+
#include <PIDfromBT.h>
12+
13+
#define MAX_IDEAL 1000
14+
#define MIN_IDEAL -1000
15+
16+
// Definición de constantes
17+
float kp = 0, ki = 0, kd = 0;
18+
int ideal = 0;
19+
int vel = 0;
20+
int suc = 0;
21+
22+
// Creación del Objeto PIDfromBT
23+
PIDfromBT pid_calibrate(&kp, &kd, &ki, &vel, &ideal, &suc, DEBUG);
24+
25+
void setup() {
26+
// Inicia el Serial
27+
Serial.begin(9600);
28+
29+
// Establece los valores Máximo y Mínimo del Ideal
30+
pid_calibrate.setMinIdeal(MIN_IDEAL);
31+
pid_calibrate.setMaxIdeal(MAX_IDEAL);
32+
33+
}
34+
35+
void loop() {
36+
// Ejecutar el update() para revisar si hay instrucciones en el Buffer
37+
pid_calibrate.update();
38+
}

0 commit comments

Comments
 (0)