Skip to content

Instantly share code, notes, and snippets.

@dansku
Created August 12, 2018 19:02
Show Gist options
  • Save dansku/f94dd3fcea21e2f43a9cf7f968974154 to your computer and use it in GitHub Desktop.
Save dansku/f94dd3fcea21e2f43a9cf7f968974154 to your computer and use it in GitHub Desktop.
int relayPin = D7; // choose the pin for the LED
int openCall(String extra) {
digitalWrite(relayPin, LOW);
delay(1500);
digitalWrite(relayPin, HIGH);
Particle.publish("house_door_open"); // Slack web hook to open the door
return 1;
}
void setup()
{
Particle.function( "open", openCall );
delay(5000); // Allow board to settle
Blynk.begin(auth); // Blynk auth
pinMode(relayPin, OUTPUT); // Set relay as output
digitalWrite(relayPin, HIGH); // Initialize relay pin as HIGH
}
void loop()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment