Created
November 16, 2015 01:14
-
-
Save jhawthorn/6f3bbb3cc4cc130bd18f to your computer and use it in GitHub Desktop.
A wifi temperature sensor using a particle photon
This file contains 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
// This #include statement was automatically added by the Particle IDE. | |
#include "Particle-OneWire/Particle-OneWire.h" | |
// This #include statement was automatically added by the Particle IDE. | |
#include "particle-dallas-temperature/particle-dallas-temperature.h" | |
// Init Dallas on pin digital pin 6 | |
DallasTemperature dallas(new OneWire(D6)); | |
double temperature; | |
void setup(){ | |
Particle.variable("temp", &temperature, DOUBLE); | |
Serial.begin(9600); | |
dallas.begin(); | |
} | |
void loop(){ | |
dallas.requestTemperatures(); | |
temperature = dallas.getTempCByIndex( 0 ); | |
delay(2000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where are the Particle-OneWire.h and particle-dallas-temperature.h libraries located? I can only find the Spark version in the Particle IDE.