Go Down

Topic: Problem reading Batt from MKRFOX (Read 223 times) previous topic - next topic



I'm using a MKRFOX1200 to monitor some values and batt level.

To measure the batt level I'm using this code:

Code: [Select]
int sensorValue = analogRead(A0);
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  float sbatt = sensorValue * (5 / 1023.0);

But the results are not true. I connect a battery to the screws and I measure the voltage with a voltimeter and the result is 3.2V.

Using this script the result is 2.98, anybody knows why?

Thank's in advance


Go Up