#define LED 18
int brightness = 0;
int fadeamount = 5;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(LED, OUTPUT);
}
void loop() {
analogWrite(LED,brightness);
brightness = brightness + fadeamount;
if(brightness <=0 || brightness >=255)
{
fadeamount = -fadeamount;
}
delay(30);
}