MicroMod Artemis expected unqualified-id error

Hello, I have a MicroMod datalogging carrier board with a MicroMod Artemis processor that I am trying to use with multiple sensors. I keep getting compile errors for my temp TSYS01 and pressure MS5837 sensors and cannot get past the examples provided within the libraries. I have uninstalled and reinstalled apollo3, the libraries etc. and have also successfully compiled both on a RedBoard Artemis with no errors. Blink and my other sensors compile with the MicroMod so it is specific to the TSYS01 and MS5837. I get the same error for both sensors saying I have an expected unqualified-id before numeric constant D1. I do not know how to update the macros in the micromod or what I can do to fix this error. Any help is greatly appreciated.

In file included from C:\Users\natal\AppData\Local\Arduino15\packages\SparkFun\hardware\apollo3\1.2.1/cores/arduino/ard_sup/Arduino.h:87,

from sketch\MS5837_Example.ino.cpp:1:

C:\Users\natal\AppData\Local\Arduino15\packages\SparkFun\hardware\apollo3\1.2.1\variants\artemis_micromod/config/variant.h:72:12: error: expected unqualified-id before numeric constant

#define D1 1

^

C:\Users\natal\OneDrive\Documents\Arduino\libraries\BlueRobotics_MS5837_Library/MS5837.h:88:11: note: in expansion of macro ‘D1’

uint32_t D1, D2;

^~

exit status 1

Error compiling for board SparkFun Artemis MicroMod.

Hi Natalia,

I’ve experienced this a few times with the MicroMod variant.h definitions. It’s a common issue because “G” and “D” definitions are pretty generic and frequently used in other libraries.

You can either alter the MS5837 library to change the D1 definition to something else, though be aware how it is used. Alternatively, you can go into the MicroMod Artemis variant.h file and comment out the D1 definition. You’ll need to make sure that any future references to D1 are 0 (zero) instead if you do (the actual pin it refers to). This may be the simpler approach instead of potentially breaking the library.

https://github.com/sparkfun/Arduino_Apo … .h#L71-L72

On MacOS the variant.h file is located in the following directory:

/Users/adam/Library/Arduino15/packages/SparkFun/hardware/apollo3/1.2.3/variants/artemis_micromod/config/variant.h

If you’re on Windows, I suspect it’ll be very similar.

Cheers,

Adam

Hi Adam,

Commenting out the D1 definition worked and now both compile, thank you so much!

Natalia