void loop() {
int i, j;
i=j=1500;
while (i>500 && j<2500) {
ruotadestra.writeMicroseconds(i);
ruotasinistra.writeMicroseconds(j);
i-=100;
j+=100;
}
}
The problem is that, for each iteration, the board loses the connection. I have understood that it is a error in codes, but I don't understand what. Can you help me?
Thank you!
The problem is that, for each iteration, the board loses the connection. I have understood that it is a error in codes, but I don't understand what. Can you help me?
Thank you!
Are you powering your servos from the arduino? If so, this usually causes the arduino to crash and reset.
Just use a four AA pack for the servos, and use whatever you're using at the moment to power the Arduino (I'll assume it isn't a 9V radio battery)
Connect the grounds together.