Smart Home Automation Forum
[Arduino source code for KC868-A2]-01 DS18B20 - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20)
+--- Forum: KC868-A2 (https://www.kincony.com/forum/forumdisplay.php?fid=43)
+--- Thread: [Arduino source code for KC868-A2]-01 DS18B20 (/showthread.php?tid=2636)



[Arduino source code for KC868-A2]-01 DS18B20 - KinCony Support - 03-02-2023

Code:
#include <DS18B20.h>

DS18B20 ds1(33); 
DS18B20 ds2(14); 
void setup() {
  Serial.begin(115200);
}
void loop() {

      Serial.print("Temperature1 is ");
      Serial.print(ds1.getTempC());
      Serial.println(" C");
      delay(500);
      Serial.print("Temperature2 is ");
      Serial.print(ds2.getTempC());
      Serial.println(" C");
      delay(500);
}