MicroPressure Sensor on Nano Every

I thought it was just my code, but the basic readings example for the Qwiic MicroPressure Sensor won’t compile for a Nano Every. Looks like the PA in the enum collides with something in MegaAVR. Anyone else having issues? Suggestions?

It looks like there’s a naming conflict with MegaAVR and the use of “PA” for pascals in our example; I have submitted a fix for the library which might be incorporated…in the meantime you can just use a workaround. For the example1.ino file, you can add these lines at the top of the sketch

#include <Wire.h>

// Undefine the conflicting MegaAVR macro

#ifdef PA
#undef PA
#endif

#include <SparkFun_MicroPressure.h>

Thanks for the quick response. I used the undef and it worked on the sample code, but not my code, for some reason. I finally, in desperation altered the PA in the library’s .cpp and .h files to PAS.

My code compiles now. I’ll need some tuning to test.

Best regards,

Craig Battles
Phone: 206-251-7222

1 Like

That’s very close to the github pushes I submitted :wink:

Awesome, enjoy! Apologies for the library weirdness