Skip to content

Instantly share code, notes, and snippets.

@gallirohik
Created August 22, 2018 02:21
Show Gist options
  • Select an option

  • Save gallirohik/c5c7c82ada7208c461f5ca16682bbda1 to your computer and use it in GitHub Desktop.

Select an option

Save gallirohik/c5c7c82ada7208c461f5ca16682bbda1 to your computer and use it in GitHub Desktop.
IOT project (Smart Door)
void setup() {
// put your setup code here, to run once:
pinMode(4,INPUT);
pinMode(13,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.begin(115200);
if(digitalRead(4))
{
digitalWrite(13,LOW);
Serial.println("DOOR is Closed...!");
}
else
{
digitalWrite(13,HIGH);
Serial.println("DOOR is Opened...!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment