Eduardo GarciaRay LIng
Published © GPL3+

What To Wear LCD

Ever wondered what to wear due to unpredictable weather Wonder no longer!

IntermediateShowcase (no instructions)10 hours351
What To Wear LCD

Things used in this project

Hardware components

LED (generic)
LED (generic)
or tri-led
×3
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
doesn't have to be RGB
×1
Photon
Particle Photon
×1
Breadboard (generic)
Breadboard (generic)
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×16
housing box
something big enough to house everything
×1

Software apps and online services

Particle Pi
Particle Pi
Maker service
IFTTT Maker service

Story

Read more

Schematics

LCD Wiring

We used help from http://blog.jongallant.com/2015/10/particle-photon-lcd-setup/
Lcdsetup 0ao3w2lbv8

Piezo Wiring

We figured this one out on our own but the image belongs to http://diotlabs.daraghbyrne.me/6-controlling-outputs/piezo/
Piezo 1 yli7thtdio

Tri-LED Wiring

We also figured this out on our own but the image shows how to set it up. The image belongs to http://johnny-five.io/examples/led-rgb/
Led rgb qpfkvvfd6h

Code

What to Wear Code

JavaScript
Use in build.particle.io and http://blog.jongallant.com/2015/10/particle-photon-lcd-setup/ helped with the building blocks of the LCD code
#include "LiquidCrystal/LiquidCrystal.h"
LiquidCrystal lcd(D0, D1, D2, D3, D4, D5);
int ledHot = A0;
int ledCool = A1;
int ledCold = A2;
int sound = A5; 
int temp;

void setup() {

lcd.begin(16,2);
pinMode(sound, OUTPUT);
pinMode(ledHot,OUTPUT);
pinMode(ledCool, OUTPUT);
pinMode(ledCold, OUTPUT);
Particle.function("Clothing",clothingChoice);
digitalWrite(sound, LOW);
digitalWrite(ledCool, LOW);
digitalWrite(ledCold, LOW);
digitalWrite(ledHot, LOW);

}

void loop() {
   
}
int clothingChoice(String input){
    temp = atoi(input);
    if ((temp <= 80)&&(temp >= 61)){

        lcd.print("Cool wear Pants" );
        digitalWrite (ledCool, HIGH);
        digitalWrite (ledCold, LOW);
        digitalWrite (ledHot, LOW);
        digitalWrite(sound, HIGH);
        delay (2500);
        digitalWrite (ledCool, HIGH);
        digitalWrite (ledCold, LOW);
        digitalWrite (ledHot, LOW);
        digitalWrite(sound, HIGH);
        delay(2500);
        digitalWrite (ledCool, LOW);
        digitalWrite (ledCold, LOW);
        digitalWrite (ledHot, LOW);
        digitalWrite(sound, LOW);
        delay(10500);
        lcd.clear();
        return 1;
       
    }else if (temp <= 60){
    lcd.print ("Wear sweater cold");
    digitalWrite (ledCold, HIGH);
    digitalWrite (ledCool, LOW);
    digitalWrite (ledHot, LOW);
    digitalWrite(sound, HIGH);
    delay(2500);
    digitalWrite (sound, HIGH);
    digitalWrite (ledCold, HIGH);
    digitalWrite (ledCool, LOW);
    digitalWrite (ledHot, LOW);
    delay (2500);
     digitalWrite (sound, LOW);
    digitalWrite (ledCold, LOW);
    digitalWrite (ledCool, LOW);
    digitalWrite (ledHot, LOW);
    delay(10500);
    lcd.clear();
    return 2;
    
    }
else if (temp >= 81){
    lcd.print ("Wear shorts hot");
    digitalWrite (ledHot, HIGH);
    digitalWrite (ledCold, LOW);
    digitalWrite (ledCool, LOW);
    digitalWrite(sound, HIGH);
    delay (2500);
    digitalWrite (ledHot, HIGH);
    digitalWrite (ledCold, LOW);
    digitalWrite (ledCool, LOW);
    digitalWrite(sound, HIGH);
    delay (2500);
    digitalWrite (ledHot, LOW);
    digitalWrite (ledCold, LOW);
    digitalWrite (ledCool, LOW);
    digitalWrite(sound, LOW);
    delay(10500);
    lcd.clear();
    return 3;
    
} 
else {
    return -1;
}
}

Credits

Eduardo Garcia

Eduardo Garcia

0 projects • 0 followers
Contact
Ray LIng

Ray LIng

1 project • 0 followers
Contact

Comments

Add projectSign up / Login