Smart Home Automation Forum
[Arduino source code for KC868-A4S]-05 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-A4S (https://www.kincony.com/forum/forumdisplay.php?fid=41)
+--- Thread: [Arduino source code for KC868-A4S]-05 DS18B20 (/showthread.php?tid=2629)



[Arduino source code for KC868-A4S]-05 DS18B20 - KinCony Support - 03-02-2023

Code:
/*KC868-A4S DS18B20 CODE*/
#include <DS18B20.h>
DS18B20 ds1(5);  //channel-1-DS18b20
DS18B20 ds2(14);  //channel-2-DS18b20

void setup()
{
  Serial.begin(115200);
}

void loop()
{
  Serial.print("Temperature1:");
  Serial.print(ds1.getTempC());
  Serial.println(" C /");
  delay(100);
  Serial.print("Temperature2:");
  Serial.print(ds2.getTempC());
  Serial.println(" C /\n");
  delay(100); 
}