Monitor 12v battery


It took me a min to figure out how to feed this function the data it wanted but now I have it working for me :wink: Thanks for posting the code.

Nobody else on the net added the // Avoid div/zero line.


That may be due to the fact that AVR based Arduinos don’t panic on a DIV/0 but ARM based systems do and I suggest to make defensive programming a habit.


Here is a better idea
For measuring voltage and current without volt dividers.