Created
September 26, 2017 21:41
-
-
Save rveitch/c3acab292d61b17cb6fa93b19919cccb to your computer and use it in GitHub Desktop.
Particle Temperature Sensor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Adafruit_DHT.h> | |
| #include "Adafruit_DHT.h" | |
| #define DHTPIN 2 // what pin we're connected to | |
| #define DHTTYPE DHT22 // DHT 22 (AM2302) | |
| DHT dht(DHTPIN, DHTTYPE); | |
| void setup() { | |
| dht.begin(); | |
| } | |
| void loop() { | |
| delay(60000); // Wait a minute between measurements. | |
| float h = dht.getHumidity(); | |
| float f = dht.getTempFarenheit(); // Read temperature as Farenheit | |
| Particle.publish("temp", String::format("%4.1f", f), PRIVATE); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment