hi,
have raspberry pi 0 , want power battery. works, want check voltage of battery, in order know when have recharge it.
that, tried use mcp3002 , mcp3002() class in gpiozero. problem retrieved value 0. everytime. , don't understand why.
below circuit. it's pretty simple: battery provides 5v created voltage divider, , read voltage via channel 0. wrote simple program read value: it's classic circuit, saw on several places, and, if i'm not wrong, have same. that's why don't understand why 0… idea?
have raspberry pi 0 , want power battery. works, want check voltage of battery, in order know when have recharge it.
that, tried use mcp3002 , mcp3002() class in gpiozero. problem retrieved value 0. everytime. , don't understand why.
below circuit. it's pretty simple: battery provides 5v created voltage divider, , read voltage via channel 0. wrote simple program read value:
code: select all
from gpiozero import mcp3002 mcp = mcp3002() print mcp.value
that circuit 26 pin expansion header. pi 0 has 40 pin expansion header. perhaps have not connected correct pins? photo may help.
raspberrypi
Comments
Post a Comment