Code compiles for Argon but not Boron

Good Morning

My project runs and compiles successfully on Argon but does not compile for Boron. Is there change that I need to make or should it work?

thanks in advance

Hard to say with neither knowing your code nor getting any info about your build errors.

I have managed to solve it. I was just panicking with all the Make errors at the end. Going through the output I saw that BATT was undefined. when compiling for Boron

  pinMode(BATT, INPUT); // argon battery 

It looks like the pinmap_defines.h is not included for Boron but it is for Argon.

I simply added the following and it compiles now

#define BATT 33 // used for Boron compile

That will get it to compile, but won’t produce a valid result. There is no battery connection to an ADC on the Boron, because it’s connected to the MAX17043 fuel gauge, which produces a far more accurate results.

System.batteryCharge() returns a float that is a percentage charge from 0.0 to 100.0.

https://docs.particle.io/reference/device-os/firmware/boron/#batterycharge-

If you really need the voltage you can get it using the FuelGauge method getVCell().

Pin 33 on the Boron is the PMIC I2C SDA line. Not sure what you’ll get from analogRead(), probably 0, but definitely not a valid value, regardless.

1 Like