Abdulrahman AlabdullatifAbdulatif Mohammad
Published

Gmail Photon Notifier

Have you ever been distracted by your phone while studying, but you still need it for schools email. We've got the solution for you!

IntermediateFull instructions provided4 hours609
Gmail Photon Notifier

Things used in this project

Story

Read more

Schematics

Schematic

Here is the Schematic For the notifier and control panel Photons that was used in this project.

Code

Control Panel code

C/C++
Here is the code used for the Control Panel photon that was used in this project. See operation section for more information in which it shows how it operates.
SYSTEM_THREAD(ENABLED)
bool buttonset = false;

void setup()
{
Particle.subscribe("email011", writetoscreen); 
//receive from IFTTTT send to function
}

  
void writetoscreen(const char *event, const char *data)
{
    if(strcmp(event,"email011")==0) 
    { //compare variable and determine meaning
        
        Particle.publish("email100","email011", 60);
}}

void loop() {
    if (System.buttonPushed() > 500) {
        Particle.publish("done100", "buttonpressed", 60); 
        buttonset = true;
        delay(5000);
    }
}

Notifier Code

C/C++
Here is the code used for the notifier photon that was used in this project. See operation section for more information in which it shows how it operates.
int boardLed = D7;


void setup()
{
    Particle.subscribe("email100", flickerled);
    Serial.begin(230400);
    pinMode(boardLed,OUTPUT); // Our on-board LED output
    Particle.subscribe("done100",button);
}
void flickerled (const char *event, const char *data)
{

    if(strcmp(data, "1")==0)
{
        digitalWrite(boardLed,HIGH);
        Serial.println("1");
}
}
void button(const char *event, const char *data)
{
    if(strcmp(data,"buttonpressed")==0)
    {
        digitalWrite(boardLed,LOW);
        delay(15000);
}
}

Credits

Abdulrahman Alabdullatif

Abdulrahman Alabdullatif

1 project • 1 follower
Abdulatif Mohammad

Abdulatif Mohammad

1 project • 0 followers

Comments