// put your setup code here, to run once:
int ledPin = 2;
int potensioPin = 34;
int val = 0;
void setup()
{
Serial.begin(115200);
Serial.println("Hello, ESP32!");
}
void loop() {
// put your main code here, to run repeatedly:
val = analogRead(potensioPin);
int pwm = val / 4;
analogWrite(ledPin, pwm);
Serial.print("Nilai PWM adalah : ");
Serial.println(pwm);
Serial.println(val);
}