Created
August 12, 2018 19:02
-
-
Save dansku/f94dd3fcea21e2f43a9cf7f968974154 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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