Completely intermittently (once or twice a day, running all day), and without making a call to any Servo class methods, it will jump around. AFAIK know, the power is stable. But, I am wondering if perhaps some noise on the data pin is causing it. It's a very LARGE software application, so, I won't include the dozens of files here. Included is the simplest version. That said, I can tell you none directly share this pin, but, I do have a timer, serial, other PWM and TFT software running here. None, however access the Servo pin.
Code: Select all
#include <ESP32Servo.h>
#define GATE_PIN 13
#define GATE_CHANNEL 5
Servo _Gate;
..
void setup()
{
..other stuff..
ESP32PWM::allocateTimer(GATE_CHANNEL);
_Gate.setPeriodHertz(50);
}
void loop()
{
..other stuff..
//This code is the ONLY thing that SHOULD make it move
//However, once every few hours or so, it'll move anyways (usually to 0 degree angle)
if ( false )
{
_Gate.attach(GATE_PIN);
_Gate.write(_someAngle);
delay(500);
_Gate.detach();
}
delay(5000);
}