#include <Arduino.h>
#define SIGNAL 22
int freq = 10000;
int ledChannel1 = 0;
int resolution = 10;
void setup() {
ledcSetup(ledChannel1, freq, resolution);
ledcAttachPin(SIGNAL, ledChannel1);
}
void loop() {
for(int i=0; i < 500; i++){
ledcWrite(ledChannel1, i);
delay(2);
}
for(int i=500; i > 0; i--){
ledcWrite(ledChannel1, i);
delay(2);
}
}