Smart Home Automation Forum
[Arduino IDE demo source code for KC868-A8S]--#04-KC868-A8S_DS18B20_code - 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-A8S (https://www.kincony.com/forum/forumdisplay.php?fid=24)
+--- Thread: [Arduino IDE demo source code for KC868-A8S]--#04-KC868-A8S_DS18B20_code (/showthread.php?tid=1953)



[Arduino IDE demo source code for KC868-A8S]--#04-KC868-A8S_DS18B20_code - KinCony Support - 06-01-2022

[Arduino IDE demo source code for KC868-A8S]--#04-KC868-A8S_DS18B20_code

Code:
/*KC868-A8S DS18B20 Temperature sensor code*/

#include <DS18B20.h>
DS18B20 ds1(14);  //channel-1-DS18b20  IO14


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

void loop()
{
  Serial.print("Temperature1:");
  Serial.print(ds1.getTempC());
  Serial.print(" C /");
  delay(500);   
}