Ciao a tutti,
devo pilotare un esc, e come ho letto, serve la libreria servo.
Ho notato che il mio esc fa girare il motore solamente con un range tra 88 e 135.
Com'è possibile ?
In allegato trovate lo sketch che ho usato per testare il tutto.
Con questo sketch per incrementare di 1 basta inviare un + sulla seriale, per diminuire basta un -.
Grazie
#include <Servo.h>
Servo motore;
int speed = 0;
int rx = 0;
void setup() {
Serial.begin(9600);
motore.attach(2);
Serial.println("Avvio");
}
void loop() {
motore.write(speed);
if (Serial.available() > 0) {
rx = Serial.read();
if (rx == 43) {
speed += 1;
Serial.print("+ Vel: ");
Serial.println(speed, DEC);
}
if (rx == 45) {
speed -= 1;
Serial.print("- Vel: ");
Serial.println(speed, DEC);
}
}
}