Data Sheet
22 : circuit 1b
WHAT YOU
SHOULD SEE
You should see the LED blink faster
or slower in accordance with your
potentiometer. The delay between each
flash will change based on the position
of the knob. If it isn’t working, make
sure you have assembled the circuit
correctly and verified and uploaded
the code to your board. If that doesn’t
work, see the Troubleshooting section.
PROGRAM OVERVIEW
Read the position of the potentiometer (from 0 to 1023) and store it in the variable potPosition.
Turn the LED on.
Wait from 0 to 1023 milliseconds, based on the position of the knob and the value of potPosition.
Turn the LED off.
Wait from 0 to 1023 milliseconds, based on the position of the knob and the value of potPosition.
Repeat.
Open the Arduino IDE
Connect the RedBoard to a USB port on your computer.
Open the Sketch:
File > File > Examples > SIK_Guide_Code-V_4 > CIRCUIT_B-POTENTIOMETER
Select UPLOAD to program the sketch on the RedBoard.
SIK v4 Book Oct 13.indb 22 10/18/17 9:59 AM