I'm trying to get the temperature from an SHT15 sensor using the sample code at HumidityTemperatureSHT15 \ Learning \ Wiring (at least I think that's where it came from; I'm collaborating with someone else on this project). I know the SHT15 is wired correctly, but I'm getting Ack Error 2, which I think signifies that the acknowledgement from the SHT15 was never received. The temperature that my Arduino is dumping to serial is 0xFFFFFFD8. I calculated the raw value the SHT15 is returning as 0x8E38E3AF (thanks to Wolfram|Alpha). I've tried extending the wait period in waitForResultSHT(), but that doesn't seem to help. Can anybody help this noob?
I sense that full code would be helpful. Here it is.
@PaulS I cloned that library and opened up the example but found that my readings were consistently failing, same as @mathphreak, but without it reporting ACK errors.
I posted an issue, but thought that I would reach out in additional places.
How long are the cables between Arduino and the SHT15?
A quick look at the code triggert the following question:
think some int's should be unsigned int or ..
int getData16SHT(int dataPin, int clockPin) {
int val;
// Get the most significant bits
pinMode(dataPin, INPUT);
pinMode(clockPin, OUTPUT);
val = shiftIn(dataPin, clockPin, 8);
val *= 256; << if val = 0xFF there will be a signed overflow!
....
==>
unsigned int getData16SHT(int dataPin, int clockPin) {
unsigned int val = 0;
// Get the most significant bits
pinMode(dataPin, INPUT);
pinMode(clockPin, OUTPUT);
val = shiftIn(dataPin, clockPin, 8);
val *= 256;
....