Things used in this project

Hardware components:
Photon new
Particle Photon
×1
12002 04
Breadboard (generic)
×1
Adafruit industries ada592 image 75px
USB-A to Micro-USB Cable
for power
×1
398 09
Adafruit RGB Backlight LCD - 16x2
×1
Bourns 3362p 1 103lf image 160px
Single Turn Potentiometer- 10k ohms
×1
Software apps and online services:
Q8wtlimqnp04fzhtr9v5
IFTTT Maker service

Code

Untitled fileC/C++
#include <Adafruit_DHT.h>
#include "application.h"
#include "LiquidCrystal/LiquidCrystal.h"
#include "Adafruit_DHT/Adafruit_DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT11
int HT = 1;
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(D0, D1, A2, D3, D4, D5);
void setup() {
  lcd.begin(16,2);
  dht.begin();
  Particle.function("T-H", ReadHT);
  lcd.print("Temp:          F");
}
void loop() {
    if (HT == 1) {
    lcd.setCursor(10,0);
    lcd.print(dht.getTempFarenheit());
    }
    if (HT == 0) {
    lcd.setCursor(10,0);
    lcd.print(dht.getHumidity());
    }
}
int ReadHT(String command) {
    if (command=="Temperature") {
        lcd.setCursor(0,0);
        lcd.print("Temp:          F");
        HT = 1;
    }else
    if (command=="Humidity") {
        lcd.setCursor(0,0);
        lcd.print("Humidity:      %");
        HT = 0;
    }else
    {
        return -1;
    }
}

Credits

Dd9931d49dfa62ff7e5aa18b1e0cd52c
Duncan Birdsall
1 project • 0 followers
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Add projectSign up / Login