Back to Parent

int solPin = D2;

bool shouldActivate = false;

void setup()
{
  //Subscribe to an event that is triggered 15 minutes before a Google Calendar event using IFTT
  Particle.subscribe(  "activate",activateSolenoid  );

  pinMode(solPin, OUTPUT);
}

void loop()
{
}

//When event is received activate the Solenoid
void activateSolenoid(const char *event, const char *data)
{
    do_Solenoid();

}

//Turn the Solenoid off and on
void doSolenoid(  ){
    digitalWrite( D2, HIGH ); 
    delay (1000);
    digitalWrite(D2,LOW);
    delay (1000);
}
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0