Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1247

Python • Re: MPC3008 input.value is 0.0004885197850512668

$
0
0
You should only create your MCP3008 object once, then repeatedly read its value.

Code:

from gpiozero import MCP3008import timepot = MCP3008(0)while True:    print(pot.value)    time.sleep(1)

Statistics: Posted by rpiMike — Tue Mar 04, 2025 1:58 pm



Viewing all articles
Browse latest Browse all 1247

Trending Articles