ArduinoSystemStatus icon indicating copy to clipboard operation
ArduinoSystemStatus copied to clipboard

How use GetVBatt

Open wataruland opened this issue 7 years ago • 1 comments

Hello, how should this library be used to read the value in volts of a battery in pin A2, I have this:

VoltVCC = SystemStatus (). GetVCC (); SystemStatus (). Pin_batt = PB4; // I tested with A2 VoltBateria = SystemStatus (). GetVBatt (VoltVCC);

I have the ATTiny is powered by 5v and the battery is 1.5v, and if the function getVCC () works for me, but I do not know how to do it with getVBatt (). always returns 0

wataruland avatar Jul 09 '18 21:07 wataruland

Hello again.

I have already seen my error, the call must be:

#define VOLT A2 .... VoltVCC = SystemStatus (). GetVCC (); VoltBateria = SystemStatus (VOLT) .getVBatt (VoltVCC);

It works perfectly and thank you very much for the library, very useful: D

wataruland avatar Jul 09 '18 22:07 wataruland