/*Kelompok 3 Sisben
Callula Rizky Shauma (2106733774)
Steven Jones Hadisaputra (2106653533)
Irdina Rusyda Kamila Arsil (2106651566)
Salsabila Pramesthi Yasmin (2106653325)*/
#define buzzer 14
#define redPin 15
#define greenPin 2
#define bluePin 4
const int freq1 = 800;
const int freq2 = 1000;
const int freq3 = 2000;
const int ledChannel = 0;
const int resolution = 8;
void setup() {
// put your setup code here, to run once:
ledcAttachPin(bluePin, ledChannel);
ledcAttachPin(buzzer, ledChannel);
}
void loop() {
delay(500);
ledcSetup(ledChannel, freq1, resolution);
for(int dutyCycle = 0; dutyCycle <= 255; dutyCycle++){
// changing the LED brightness with PWM
ledcWrite(ledChannel, dutyCycle);
delay(10);
}
delay(500);
ledcSetup(ledChannel, freq2, resolution);
for(int dutyCycle = 0; dutyCycle <= 255; dutyCycle++){
// changing the LED brightness with PWM
ledcWrite(ledChannel, dutyCycle);
delay(10);
}
delay(500);
ledcSetup(ledChannel, freq3, resolution);
for(int dutyCycle = 0; dutyCycle <= 255; dutyCycle++){
// changing the LED brightness with PWM
ledcWrite(ledChannel, dutyCycle);
delay(10);
}
}