How to solve conflicting declaration on the Library?

  arduino-ide, c++, nodemcu, sensors, temperature

This is my code to build SHT10 reading. But I got an error message. It says that pin D1 is conflicting between Sensirion.cpp and arduino.h

#include <Sensirion.h>
#include <SensirionSHT.h>

SensirionSHT Sensor = SensirionSHT(4, 5);

long delayTime = 1;

void setup() {
  Serial.begin(9600);
}

void loop() {
  Sensor.tick(delayTime);
  
  Serial.println(Sensor.getTemperature());
  
  delay(delayTime * 1000);
}

And this is the error messages

C:UsersASUSDocumentsArduinolibrariesSensirion-masterSensirion.cpp:52:15: error: conflicting declaration 'const float D1'
   const float D1  = -40.1;          // for deg C @ 5V
               ^
In file included from C:UsersASUSAppDataLocalArduino15packagesesp8266hardwareesp8266.7.4coresesp8266/Arduino.h:296:0,
                 from C:UsersASUSDocumentsArduinolibrariesSensirion-masterSensirion.cpp:21:
C:UsersASUSAppDataLocalArduino15packagesesp8266hardwareesp8266.7.4variantsnodemcu/pins_arduino.h:41:22: error: 'D1' has a previous declaration as 'const uint8_t D1'
 static const uint8_t D1   = 5;
                      ^
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

Source: Windows Questions C++

LEAVE A COMMENT