#define LED_chan 0 // <<<< ==== two different channels used
#define Servo_chan 2 // 0 and 1 : don't work correctly
const int LED = 14, Servo = 13;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Demo Bug in LEDC function");
ledcSetup ( LED_chan, 123, 12); // <<<<< ===== swap the lines
ledcSetup ( Servo_chan, 50, 12); // latest setting "wins" if chan 0 and 1 are used
ledcAttachPin ( LED, LED_chan);
ledcAttachPin ( Servo, Servo_chan);
}
void loop() {
// put your main code here, to run repeatedly:
delay(250); // this speeds up the simulation
int value0 = analogRead ( A0 );
int value3 = analogRead ( A3 );
ledcWrite ( LED_chan, value3);
// 12 Bit PWM Resolution, 50Hz => T=20ms
// PMW-value 408 => 0.1 * T = 2ms, 204 => 0.05 * T = 1ms
int Servo_Pos = map (value0, 0, 4095, 204, 408);
ledcWrite ( Servo_chan, Servo_Pos);
}
Pot@VP/A0/GPIO36
Pot@VN/A3/GPIO39