-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
SHT40 Raspberry Pi Pico Arduino Earle Phillhower #35
Comments
on a cursory check, I believe you didn't initialize the SHT library on Wire1. Could you change the call of |
thanks for fast reply...still getting the same message: Error in readSample() as you can see in my code. |
could you print the complete output? As a further test, running I2CScanner helps: https://playground.arduino.cc/Main/I2cScanner/. This should detect a sensor responding on the SHT40's I2C address |
yeah, I was getting init(): failed responses...so I tried the I2C scanner and even the scanner cant find it... here is the code: const byte PICO_I2C_ADDRESS = 0x44; void setup() Serial.begin(9600); void loop() Serial.println("Scanning..."); nDevices = 0;
} delay(5000); // wait 5 seconds for next scan |
Hello, I have a problem with your library in arduino with Earle Phillpower library. I use your SHTSensor library, i think correctly but still not getting responses from SHT40. Can you please help me? (it is correctly wired - power 3,3V, pull up for SDA,SCL - 2,2kOhm resistors)
the SHT40 is connected to
GP14 --> PIN 19 on the Pico
GP15 --> PIN 20 on the Pico
`
#include <Wire.h>
#include "SHTSensor.h"
SHTSensor sht(SHTSensor::SHT4X);
float actualTemperature = 99.9;
float actualHumidity = 99.9;
void setup() {
pinMode(14,INPUT);
pinMode(15,INPUT);
Wire1.setSDA(14);
Wire1.setSCL(15);
Wire1.begin(0x44);
Serial.begin(9600);
while (!Serial)
delay(10);
if (sht.init()) {
Serial.print("init(): success\n");
} else {
Serial.print("init(): failed\n");
}
sht.setAccuracy(SHTSensor::SHT_ACCURACY_MEDIUM);
}
void loop() {
if (sht.readSample()) {
actualHumidity = sht.getHumidity();
Serial.print(actualHumidity, 2);
Serial.print("\n");
Serial.print(" T: ");
actualTemperature = sht.getTemperature();
Serial.print(actualTemperature, 2);
Serial.print("\n");
Serial.print("Reading SHT40 Data...OK\n");
} else {
Serial.print("Error in readSample()\n"); // this is being displayed in serial monitor - so sht.readSample() doesnt read anything
}
delay(1000);
}
`
The text was updated successfully, but these errors were encountered: