
keyestudio
www.keyestudio.cc
13
val=analogRead(potpin);// read the analog value from the sensor and assign it to val
Serial.println(val);// display value of val
analogWrite(ledpin,val/4);// turn on LED and set up brightness
(
maximum output of PWM is 255
)
delay(10);// wait for 0.01 second
}
//////////////////////////////////////////////////////////
Result
After downloading the program, when we rotate the potentiometer knob, we can see changes of the
displaying value, also obvious change of the LED brightness on the breadboard.
Summary of Contents for Basic starter kit
Page 1: ...1 ...
Page 10: ...keyestudio www keyestudio cc 8 Connection for 2560 R3 ...
Page 17: ...keyestudio www keyestudio cc 15 Connection for 2560 R3 ...
Page 21: ...keyestudio www keyestudio cc 19 Connection for 2560 R3 ...
Page 25: ...keyestudio www keyestudio cc 23 Connection for 2560 R3 ...
Page 29: ...keyestudio www keyestudio cc 27 Connection for 2560 R3 ...
Page 39: ...keyestudio www keyestudio cc 37 Connection for 2560 R3 ...
Page 62: ...keyestudio www keyestudio cc 60 Connection for 2560 R3 ...
Page 66: ...keyestudio www keyestudio cc 64 Connection for 2560 R3 ...
Page 77: ...keyestudio www keyestudio cc 75 Manual for LED segment display ...
Page 78: ...keyestudio www keyestudio cc 76 Connection for R3 Connection for 2560 R3 ...
Page 90: ...keyestudio www keyestudio cc 88 Connection for 2560 R3 ...
Page 94: ...keyestudio www keyestudio cc 92 ...
Page 95: ...keyestudio www keyestudio cc 93 Connection for R3 Connection for 2560 R3 ...