#include "Seeed_SHT35.h" /*SAMD core*/ #ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE #define SDAPIN 20 #define SCLPIN 21 #define RSTPIN 7 #define SERIAL SerialUSB #else #define SDAPIN A4 #define SCLPIN A5 #define RSTPIN 2 #define SERIAL Serial #endif SHT35 sensor(SCLPIN); void setup() { SERIAL.begin(115200); delay(10); SERIAL.println("serial start!!"); if(sensor.init()) { SERIAL.println("sensor init failed!!!"); } delay(1000); } void loop() { u16 value=0; u8 data[6]={0}; float temp,hum; if(NO_ERROR!=sensor.read_meas_data_single_shot(HIGH_REP_WITH_STRCH,&temp,&hum)) { SERIAL.println("read temp failed!!"); SERIAL.println(" "); SERIAL.println(" "); SERIAL.println(" "); } else { SERIAL.println("result======>"); SERIAL.print("temperature ="); SERIAL.println(temp); SERIAL.print("humidity ="); SERIAL.println(hum); SERIAL.println(" "); SERIAL.println(" "); SERIAL.println(" "); } delay(1000); }