XIAO_BLE_Sense(mbed 2.7.2) battery charge and voltage monitor, analogRead(P0_31) does not work

Hi lguapo,

The battery connected to the JST connector on the XIAO_Expansion_Board is not connected to the XIAO port, so the voltage cannot be read. The modification in the link below #1 allows you to read the battery voltage with analonRead(A0).
XIAO nRF52840(mbed) 1-Central 2-Peripherals Project "Sleeping Posture, Heart rate, Pulse oximetry Monitor"

The battery voltage connected to the pad on the back side of XIAO can be read with analogRead(P0_31) or analogRead(PIN_VBAT). However, when using Board Service Package:“Seeed nRF52 mbed-enable Borads 2.9.1”, the patch in this post #31 is required; when using “Seeed nRF52 Boards 1.1.1”, no patch is required.

1 Like