This simple Arduino example turns on and off two LEDs connected to digital pin #6 and analog pin #3. While doing this, it will display any input value from Analog pin #1. I’ve hooked up a small potentiometer to pin 1 by connecting the potentiometer’s black wire to ground, the red wire to the 3.3V, and the green wire to Analog pin 1.

Here’s the code: