XIAO BLE Sense battery level and charging status

my conclusions:
first You have to choose library in Arduino IDE for Your XIAO board

Two Arduino Libraries

Seeed Studio XIAO nRF52840 assembles many functions in one tiny board and sometimes may not perform the best of them. Hence, Seeed has published two Arduino libraries to let it maximum the power of each function. Therefore:

  • It is recommanded to use the Seeed nRF52 Boards library if you want to apply Bluetooth function and “Low Energy Cost Function”.
  • It is recommanded to use the Seeed nRF52 mbed-enabled Boards library if you want to use it in embedded Machine Learning Applications or apply “IMU & PDM advanced function”.
  • Both libraries support very well when it comes to the basic usage, such as LED, Digital, Analog, Serial, I2C, SPI.

The Pin definition supported by these two libraries might be a little different and Seeed will keep update the wiki until it is clear.

from Getting Started with Seeed Studio XIAO nRF52840 Series | Seeed Studio Wiki

We found that working with mbed type is causing problems …so its better to choose adafruit based libraries … as did Swap_file user :slight_smile: : XIAO BLE Sense battery level and charging status - #43 by Swap_File

Then I can use even this sketch from adafruit

remembering to add this part specific to XIAO BLE board

//enable battery measuring
pinMode(VBAT_ENABLE, OUTPUT);
digitalWrite(VBAT_ENABLE, LOW);

This is my conclusion from this disscusion :slight_smile:

1 Like