pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
200 stars 166 forks source link

Pytract 2X Read External Lipo battery voltage #536

Open DMESGTA opened 3 years ago

DMESGTA commented 3 years ago

What I have done:

  1. I am using FiPy with expansion board 3.1 to read external lipo battery voltage without any issue at pin P16.
  2. Then I am trying to use the same FiPY on Pytrack 2X also with the external lipo battery.

What happen:

  1. There is no reading output from Pytrack 2X.
  2. No documentation about Pytrack 2X ADC reading pin.

What I expect:

  1. Get voltage reading from external battery lipo using Pytrack 2X from the same pinon P16

Thank you.

gijsio commented 3 years ago

Hi, Sorry to learn you're having trouble with reading the battery voltage. In the Pycoproc library (which is needed for sensor operation, you can find it here: https://github.com/pycom/pycom-libraries/tree/master/shields/lib) , we have a function called read_battery_voltage(): https://docs.pycom.io/firmwareapi/pycom/expansionboards/pycoproc2/#pyread_battery_voltage The battery monitor is connected through to the shield, instead of to the inserted module, to free up an additional ADC pin. Best, Gijs