First init.
This commit is contained in:
34
sketch_apr28a/sketch_apr28a.ino
Normal file
34
sketch_apr28a/sketch_apr28a.ino
Normal file
@@ -0,0 +1,34 @@
|
||||
#include <OneWire.h>
|
||||
#include <DallasTemperature.h>
|
||||
|
||||
#define CLT1 6
|
||||
#define CLT2 8
|
||||
|
||||
OneWire oneWire1 (CLT1);
|
||||
DallasTemperature iCLT1(&oneWire1);
|
||||
OneWire oneWire2 (CLT2);
|
||||
DallasTemperature iCLT2(&oneWire2);
|
||||
|
||||
|
||||
void setup() {
|
||||
// put your setup code here, to run once:
|
||||
Serial.begin(115200);
|
||||
iCLT1.begin();
|
||||
iCLT2.begin();
|
||||
|
||||
pinMode(CLT1, INPUT);
|
||||
pinMode(CLT2, INPUT);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// put your main code here, to run repeatedly:
|
||||
iCLT1.requestTemperatures();
|
||||
iCLT2.requestTemperatures();
|
||||
int CLTtemp1 = iCLT1.getTempCByIndex(0);
|
||||
int CLTtemp2 = iCLT2.getTempCByIndex(0);
|
||||
|
||||
Serial.println(CLTtemp1);
|
||||
Serial.println(CLTtemp2);
|
||||
|
||||
delay(1000);
|
||||
}
|
||||
Reference in New Issue
Block a user