//pin do LED
const int led = 21;
//pin do botao e valor
const int button = 27;
const int bot_aux = 0;
//pin do Pot e valor
const int pot = 4;
const int pot_aux = 8;
//propiedades do PWN
const int freq = 5000;
const int ledchannel = 0;
const int resolution = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
ledcSetup(ledchannel, freq, resolution);
ledcAttachPin(led, ledchannel);
pinMode(led, OUTPUT);
pinMode(button, INPUT);
pinMode(pot, INPUT);
}
void loop() {
for (int dutycycle = 0; dutycycle <255; dutycycle++){
ledcWrite(ledchannel, dutycycle);
delay(15);
}
ledcWrite(ledchannel, 0);
delay(2000);
}