cano64 / ArduinoSystemStatus

SystemStatus is Arduino library to get information about VCC voltage, Free RAM etc...
84 stars 14 forks source link

How use GetVBatt #7

Open wataruland opened 6 years ago

wataruland commented 6 years ago

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 commented 6 years ago

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