Samuel Miller
Created November 17, 2018 © GPL3+

IOT 41 Project

BeginnerProtip2 hours9
IOT 41 Project

Things used in this project

Hardware components

Photon
Particle Photon
×1
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1

Software apps and online services

Google Sheets
Google Sheets
Maker service
IFTTT Maker service

Story

Read more

Schematics

Schematic of Photon and Board

Code

Photon Stock Price Counter

C/C++
SYSTEM_THREAD(ENABLED)
bool buttonset = false;


void setup() {
    Particle.subscribe("stockcheck", writetoscreen);
    //Action received from Google Asistant through IFTTT

}
void writetoscreen(const char *event, const char *data)
    { 
        if(strcmp(event,"stockcheck")==0) 
    { //compare reveived action value
        
        Particle.publish("stockcheck","price", 200);
}}
void loop() {
    if (System.buttonPushed() > 200) {
        Particle.publish("stockcheck", "price", 200); 
        buttonset = true;
        delay(5000);
    }
    

}

Credits

Samuel Miller

Samuel Miller

1 project • 0 followers

Comments