Skip to content

Library does not compile for certain newer Arduino targets #20

@NeilBaner

Description

@NeilBaner

When I include the library in Arduino IDE, and compile for the Arduino Nano 33 BLE/BLE Sense boards, I get some errors due to D1 and D2 being #define-d in pins_arduino.h, from the built-in Arduino libraries, causing a conflict with the D1 and D2 variables declared in the library.

The exact error is as follows:

In file included from C:\Users\neilbaner\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.3.0\cores\arduino/Arduino.h:90:0,
                 from sketch\MS5837_Example.ino.cpp:1:
C:\Users\neilbaner\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.3.0\variants\ARDUINO_NANO33BLE/pins_arduino.h:82:14: error: expected unqualified-id before numeric constant
 #define D1   1
              ^
C:\Users\neilbaner\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 Arduino Nano 33 BLE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions