Tyler CowanNicholas
Published

Photon Calendar Notifier

Tired of writing down all your assignments in your planner? Use the photon calendar notifier to inform you when assignments open up.

IntermediateFull instructions provided12 hours820
Photon Calendar Notifier

Things used in this project

Story

Read more

Schematics

BreadBoard Schematic

Here is a schematic of the Particle photon and breadboard used for the project. Both Particle/Breadboard circuits are wired to a powersupply.

Events Graph

Shows a graphical representation of the number of events per day in the week.

Code

Messenger

C/C++
This is the code for the Messenger Photon which informs you when an event has been published by lighting up the D7 LED. The LED stays lit until the Controller Photon turns it off.
int LED = D7;

void setup()
{
    Particle.subscribe("Nickgnal", FlashLED);
    Serial.begin(230400);
    pinMode(LED,OUTPUT);
    Particle.subscribe("Assignment_Completed",button);
}
void FlashLED (const char *event, const char *data)
{

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

Controller

C/C++
This code is for the Controller Photon which communicates with the Messenger Photon and controls when to flash the D7 LED.
SYSTEM_THREAD(ENABLED)
bool buttonset = false;

void setup()
{
Particle.subscribe("New_Assignment", writetoscreen); 
}

void writetoscreen(const char *event, const char *data)
{
    if(strcmp(event,"New_Assignment")==0) 
    { 
        Particle.publish("Nickgnal","New_Assignment", 60);
}}

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

Credits

Tyler Cowan

Tyler Cowan

1 project • 0 followers
Nicholas

Nicholas

1 project • 0 followers
UNCC Engineering student

Comments