Add the following snippet to your HTML:
Here's how to use potentiometer with Arduino and LED.
Read up about this project on
/* by: di2tnugraha https://www.youtube.com/kenziechannel */ int led = 11; int pinPot = 0; int potVal = 0; void setup() { Serial.begin(9600); pinMode(led, OUTPUT); } void loop() { potVal = analogRead(pinPot); potVal = map(potVal, 0, 1023, 0, 255); analogWrite(led, potVal); Serial.println(potVal); delay(200); }
Comments