Skip to content

Instantly share code, notes, and snippets.

@jhawthorn
Created November 16, 2015 01:14
Show Gist options
  • Save jhawthorn/6f3bbb3cc4cc130bd18f to your computer and use it in GitHub Desktop.
Save jhawthorn/6f3bbb3cc4cc130bd18f to your computer and use it in GitHub Desktop.
A wifi temperature sensor using a particle photon
// 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);
}
@jackhaefner
Copy link

Where are the Particle-OneWire.h and particle-dallas-temperature.h libraries located? I can only find the Spark version in the Particle IDE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment