Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By gad
#61924 Hi
I just got my NodeMCU and tried to get an Arduino sketch i have to run on it
Im using SHT71 temperature & humidity sensor that is working fine on my Arduino Pro mini (Leonardo)

I'm using same pin layout and get all zeros in NudeMCU

any ideas ?


this is the code, simple from their example

#include <Sensirion.h>
// library from https://github.com/spease/Sensirion

const uint8_t dataPin = 4;
const uint8_t clockPin = 5;

float temperature;
float humidity;
float dewpoint;

Sensirion tempSensor = Sensirion(dataPin, clockPin);

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

void loop()
{
tempSensor.measure(&temperature, &humidity, &dewpoint);
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.print(" C, Humidity: ");
Serial.println(humidity);
// Serial.print(" %, Dewpoint: ");
// Serial.print(dewpoint);
// Serial.println(" C");
delay(2000);
}

Thanks,
User avatar
By gad
#61947 Thamks for the suggestion, already seen this mapping and confirmed the pins im using with Blink sketch

gdsports wrote:See the section on pin mapping that applies to NodeMCU boards 0.9 and 1.0.

http://esp8266.github.io/Arduino/versio ... odemcu-0-9



any other idea ?
User avatar
By gad
#61950 Oh, stupid me... I see now, I tried calling them with the PIN number.. changed it to D1/D2 and it didnt work there so I moved to D3/D4 PINs and it work there (not sure with the others did not ..)

//const uint8_t dataPin = 4;
//const uint8_t clockPin = 5;

Sensirion tempSensor = Sensirion(D3, D4);

Thanks ! :)

gdsports wrote:See the section on pin mapping that applies to NodeMCU boards 0.9 and 1.0.

http://esp8266.github.io/Arduino/versio ... odemcu-0-9