Comments (4)
on a cursory check, I believe you didn't initialize the SHT library on Wire1. Could you change the call of sht.init()
to sht.init(Wire1)
and try again?
from arduino-sht.
thanks for fast reply...still getting the same message: Error in readSample() as you can see in my code.
from arduino-sht.
could you print the complete output? sht.init()
should fail if the sensor is not detected ("init(): failed"), before readSample(). It should have either printed an error before (defaulting to Wire
) or after the change to use Wire1
, unless the Pi pico platform is working differently than other Arduinos.
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 0x44
. This should help narrow down the root cause
from arduino-sht.
yeah, I was getting init(): failed responses...so I tried the I2C scanner and even the scanner cant find it...
I am afraid that because it is a pico not arduino...it will never gonna work. Tried to change pins on pico, so I can use Wire instead of Wire1.
here is the code:
`#include <Wire.h>
const byte PICO_I2C_ADDRESS = 0x44;
const byte PICO_HUMIDITY_PRECISION = 0xFD; // high precission
const byte PICO_I2C_SDA = 12;
const byte PICO_I2C_SCL = 13;
void setup()
{
pinMode(14,INPUT);
pinMode(15,INPUT);
Wire.setSDA(PICO_I2C_SDA);
Wire.setSCL(PICO_I2C_SCL);
Wire.begin();
Serial.begin(9600);
while (!Serial); // Leonardo: wait for serial monitor
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknown error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}
`
getting No I2C devices found...
from arduino-sht.
Related Issues (17)
- I2C communication without clock stretching HOT 3
- All examples generate a compile error HOT 1
- Can't able to download Sensirion library in arduino HOT 1
- Unstable readings on the SHT85 sensor HOT 8
- SHT85 library for Particle Argon HOT 2
- [remove Compiler Warning]: caused by unused Variable in SHTSensor.h HOT 11
- Add type for SHTC3 HOT 2
- [Problem]: sht31D not updated regularly when used on Arduino nano HOT 2
- connect sensor to 2nd I2C bus HOT 4
- Allow choice of Wire, Wire1, Wire2 to use different wire (like Teensy 4.1) HOT 1
- Bootloop HOT 7
- First Reading "High" with autodetect example using SHT4x HOT 7
- Heater on SHT4x / SHT85 and status register on SHT48? HOT 1
- No response from SHT85 HOT 1
- Turn off the heater on the SHT40 HOT 7
- Error compiling in SparkFun ESP32 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino-sht.