Hi, Great video. My question, I would like to control two LEDS independently using two potentiometers, with a raspberry pi. Would I need two MCP3008 ICs or can it be done in a single MCP3008? Also how would you amend your code for this project to achieve this? Thank you
You can add 8 potentiometer in single MCP3008. I wrote code for you. But i didn't tested it. I know it will work. Please let me know it is working perfectly or not. from gpiozero import PWMLED, MCP3008 from time import sleep pot1 = MCP3008(0) pot2 = MCP3008(1) led1 = PWMLED(17) led2 = PWMLED(18) while True: if (pot1.value < 0.002): led1.value = 0 else: led1.value = pot1.value if (pot2.value < 0.002): led2.value = 0 else: led2.value = pot2.value print(pot1.value) print(pot2.value) sleep(0.01)
May be your potentiometer is not connected properly. change wires of potentiometer or check voltage with multimeter by rotating knob. if it's still near to zero. means potentiometer is not working.