I appreciate the help as always !!!
Robert,
I have appended the code with lines you mentioned...
#include "Wire.h"
#define addrs 0x10 // I2C bus address
void setup()
{
Wire.begin();
Serial.begin(9600);
}
void loop()
{
byte lobyte;
byte hibyte;
Wire.requestFrom(addrs, 4); // contents of your first four registers
while(Wire.available() < 4 ); // Check for data from slave
{
delay(5000);
lobyte = Wire.read(); // Read hum high byte
Serial.println(lobyte, DEC);
hibyte = Wire.read(); // Read hum low byte
Serial.println(hibyte, DEC);
// Hum = toHumidity(hibyte, lobyte);
// Serial.print("Humidity: ");
// Serial.println(Hum);
lobyte = Wire.read(); // Read temp high byte
Serial.println(lobyte, DEC);
hibyte = Wire.read(); // Read temp low byte
Serial.println(hibyte, DEC);
// Temp= toTemperature(hibyte, lobyte);
// Serial.print("Temperature: ");
// Serial.println(Temp);
delay(1000);
uint8_t n = Wire.requestFrom(addrs, 4);
Serial.println(n, DEC);
}
}
When i run the program, the serial monitor outputs the following (repeats):
100
20
98
117
4
100
20
98
117
4
Erdin,
Wrong sensor, i mentioned another Humidity and Temp later on the thread..take a look ![]()
Pete