// the number of the LED pin
const int ledPin = 16; // 16 corresponds to GPIO16
const int ledPin2 = 17;
const int buzzPin = 5;
// setting PWM properties
const int freq = 5000;
const int freqbuzz = 300;
const int ledChannel = 0;
const int buzzChannel = 1;
const int resolution = 8;
void setup(){
// configure LED PWM functionalitites
ledcSetup(ledChannel, freq, resolution);
ledcSetup(buzzChannel, freqbuzz, resolution);
// attach the channel to the GPIO to be controlled
ledcAttachPin(ledPin, ledChannel);
ledcAttachPin(ledPin2, ledChannel);
ledcAttachPin(buzzPin, buzzChannel);
ledcWrite(ledChannel, 255);
}
void loop(){
ledcWriteTone(buzzChannel, 300);
delay(500);
ledcWriteTone(buzzChannel, 1300);
delay(500);
ledcWriteTone(buzzChannel, 3500);
delay(500);
}