Hello,
In the code I pasted below I did not plug the RTC unit yet, however just by enabling either the Wire.h or SPI.h or Sodaq_DS3231.h library the SHT10 stops giving me values. Basically what I get is -4 and -40. The sensor works fine without using the RTC library how can I find what is causing this?
I tried the Makuna library for RTC3231 too and I think anything with #include <Wire.h> is causing problems with the SHT1x.h library at least on my system?
#include <SPI.h>
#include <Wire.h> //DS3231
#include <Sodaq_DS3231.h>
char weekDay[][4] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
//DateTime SetDateTo(2016, 3, 30, 20, 15, 10, 3); //see rtc.setDateTime(SetDateTo in setup
int OutsideHumiditySensorValue;
int OutsideTempSensorValue;
#include <SHT1x.h>
#define dataPinSHT 20
#define clockPinSHT 21
SHT1x sht1x(dataPinSHT, clockPinSHT);
void setup() { ///-----------------------------------SETUP
Serial.begin(9600);
Serial1.begin(4800); //9600bps is default for OpenLog
Wire.begin();
rtc.begin();
// rtc.setDateTime(SetDateTo); //Adjust date-time as defined 'dt' above
} ///---------------------------------SETUP---------------------------
void loop() { //--------------------------------------------LOOP:
DateTime now = rtc.now();
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
OutsideHumiditySensorValue = sht1x.readHumidity();
OutsideTempSensorValue = sht1x.readTemperatureC();
Serial.println(OutsideHumiditySensorValue);
Serial.println(OutsideTempSensorValue);
} // -----------------------------------------LOOP----------------------------