const int ledPin1 = 2;
const int ledPin2 = 4;
void setup() {
// put your setup code here, to run once:
ledcAttachChannel(ledPin1, 5000, 8,0);
ledcAttachChannel(ledPin2, 5000, 8,1);
}
void loop() {
// put your main code here, to run repeatedly:
for (int i = 0; i <= 255; i++) {
ledcWrite(ledPin1,i);
ledcWrite(ledPin2,255-i);
delay(2);
}
for (int i = 255; i >= 0; i--) {
ledcWriteChannel(0,i);
ledcWriteChannel(1,255-i);
delay(2);
}
}