Hi. Two week newb here trying to add Pots and Joysticks to a project.
Using an MPC3008 for Analog Voltage Reading, only getting one value on any channel:
0.0004885197850512668
I've found that value in a few questions that remained un-answered, and old enough to be locked. Well, there were responses and some insightful ones, but no "It is definitely this".
I've put the number in the topic so that when I resolve the issue it will be a bit more search friendly.
SPI is enabled in sudo raspi-config as per: https://www.raspberrypi-spy.co.uk/2014/ ... pberry-pi/
Code is minimal and cribbed from: https://gpiozero.readthedocs.io/en/stab ... entiometer
Board setup is as per the gpiozero docs above, except there are no LEDs attached.
![Image]()
One addition I have made is that I am measuring the voltage supplied to MPC3008(0) with a multimeter. So I can see the smooth linear sweep from 0.1V up to 3.28V as I adjust the pot.
I've made code changes to read all of the MPC3008 at once, and then tried connecting ground or 3.3V to different MPC3008 inputs.
I feel like I've missed something simple, and this mystery value is some default part of the gpiozero library or some fail state of the MPC3008.
Hoping someone who has built joysticks has encountered this number and knows what the solution is.
If I work it out, I'll add the answer. Many thanks for your time.
Using an MPC3008 for Analog Voltage Reading, only getting one value on any channel:
0.0004885197850512668
I've found that value in a few questions that remained un-answered, and old enough to be locked. Well, there were responses and some insightful ones, but no "It is definitely this".
I've put the number in the topic so that when I resolve the issue it will be a bit more search friendly.
SPI is enabled in sudo raspi-config as per: https://www.raspberrypi-spy.co.uk/2014/ ... pberry-pi/
Code is minimal and cribbed from: https://gpiozero.readthedocs.io/en/stab ... entiometer
Code:
from gpiozero import MCP3008import timewhile True: pot = MCP3008(0) print(pot.value) time.sleep(1)
One addition I have made is that I am measuring the voltage supplied to MPC3008(0) with a multimeter. So I can see the smooth linear sweep from 0.1V up to 3.28V as I adjust the pot.
I've made code changes to read all of the MPC3008 at once, and then tried connecting ground or 3.3V to different MPC3008 inputs.
I feel like I've missed something simple, and this mystery value is some default part of the gpiozero library or some fail state of the MPC3008.
Hoping someone who has built joysticks has encountered this number and knows what the solution is.
If I work it out, I'll add the answer. Many thanks for your time.
Statistics: Posted by DNA-Decay — Tue Mar 04, 2025 12:19 pm