The code

link: https://makecode.com/_13wRPrYg70iC

The potentiometer card requires analog input, unlike digital read which is only HIGH or LOW, analog read turns a range of voltages (from 0 to 3.3 Volts) into a range of numbers (0 to 1023) which we can then do things with. 

Reading and outputting the values are simple here. You read the corresponding analog pin (in this case it is A7) and graph it. 

Graph is a special function that as the values of the input changes, the lights will also move with it.