Shannon Caleigh MunozAlexa Spears
Published

Study Buddy

Know when an assignment is coming up!

BeginnerFull instructions provided9 hours4,335

Things used in this project

Hardware components

Photon
Particle Photon
×2
Shadow Box
×1
SparkFun Servo Motor
×1
Resistor 221 ohm
Resistor 221 ohm
×1
LED (generic)
LED (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×3

Software apps and online services

Maker service
IFTTT Maker service
Google Calendar

Story

Read more

Schematics

Breadboard Schematic for Particle 1

Breadboard Schematic for Particle 2

Code

Particle 1 Code

C/C++
This particle receives the variable "Yes5765776" from IFTTT when there is an event coming up on Google Calendar. When the variable is received, it tells the servo to move its hand to the "yes" position. When there is no assignment coming up, it rests in the "no" position.
int servoPin = D0;
Servo myservo;
int servoPos = 0;
void setup() {
    myservo.attach( D0 );
Particle.subscribe("Yes576577", myHandler);
}

void loop()
{}
  
void myHandler(const char *event, const char *data)
{
    if(strcmp(data,"Yes")==0)
    {
        Particle.publish("led576577", "Blink")
myservo.write(45);
delay(5000);
myservo.write(0);
}
}

Particle 2 Code

C/C++
This code receives variable from particle 1 and turns on LED when an event is received.
int led = D0;


void setup() {
digitalWrite(led,LOW);
Particle.subscribe ("Yes", myHandler);
pinMode (led, OUTPUT);
digitalWrite(led,HIGH);
delay(5000);
 digitalWrite(led,LOW);
}

void loop() {


}

void myHandler(const char *event, const char *data)
{
    if(strcmp(data,"Blink")==0) {
         digitalWrite(led,HIGH);

  
}
   else{
   }   
  }

Credits

Shannon Caleigh Munoz

Shannon Caleigh Munoz

1 project • 5 followers
Alexa Spears

Alexa Spears

1 project • 4 followers

Comments