I read about similar problems in the net and here. I lowered PWM frequency with analogWriteFreq(200); even down to 40 Hz, tryed using yield(), nothing helped.
Disabling WiFi is not an option, cause this project is an NTP controlled clock.
Any suggestions?
Thanks in advance!
[1] NodeMCU Board V2, Arduino IDE 1.6.7,
#define QUART1 D3
#define QUART2 D4
#define QUART3 D5
#define QUART4 D6
unsigned int PWM_loop;
void setup() {
analogWriteFreq(200); // to avoid flicker due to other interrupts in esp?
}
void loop()
{
for (int PWM_loop=0; PWM_loop <= 1023; PWM_loop++){
analogWrite(QUART1, PWM_loop);
analogWrite(QUART2, PWM_loop);
analogWrite(QUART3, PWM_loop);
analogWrite(QUART4, PWM_loop);
delay(5);
// yield();
}
for (int PWM_loop=1023; PWM_loop >= 0; PWM_loop--){
analogWrite(QUART1, PWM_loop);
analogWrite(QUART2, PWM_loop);
analogWrite(QUART3, PWM_loop);
analogWrite(QUART4, PWM_loop);
delay(5);
// yield();
}
}