Started wather station
This commit is contained in:
22
JavaScript/Weather Station/Tempsensor/Tempsensor.ino
Normal file
22
JavaScript/Weather Station/Tempsensor/Tempsensor.ino
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <OneWire.h>
|
||||
#include <DallasTemperature.h>
|
||||
|
||||
#define HIGH_PIN 12
|
||||
#define ONE_WIRE_BUS 13
|
||||
OneWire oneWire(ONE_WIRE_BUS);
|
||||
|
||||
DallasTemperature sensors(&oneWire);
|
||||
|
||||
void setup() {
|
||||
pinMode(HIGH_PIN, OUTPUT);
|
||||
digitalWrite(HIGH_PIN, HIGH);
|
||||
Serial.begin(115200);
|
||||
sensors.begin();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
sensors.requestTemperatures();
|
||||
Serial.println("VALID" + String(sensors.getTempCByIndex(0)));
|
||||
delay(100);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user