I just read this article and found it an interesting approach to measuring battery voltage w/o requiring any external hardware. Does anyone have any experience with this? Could this be accomplished using the Register class or would it have to be baked in at a lower level?
that requires the hardware to support it - so will possibly vary depending on which processor is in use, and may not be possible on any/all. Likely register class would be the simplest way to get to this if it’s possible.
The STM32 (Cerberus & co) has a special ADC channel for measuring the voltage supplied to VBAT. You need to enable it, do your conversion(s), then disable it, because enabling it turns on a voltage divider that will cause the battery to drain faster.
You should be able to quite easily access it via the Register class.
The STM32 also has a special ADC channel for measuring the temperature of the core.