edge lab LIVE! starts Tuesday in Munich. Grab a workshop seat and take home the board you build on. Code FRIEND-HACKSTER saves 20%. () Learn more!
grecia_salazar1212fabiola0522
Published

Door for Automatic Premises

My project consists of a door that opens when pressing one of the buttons that are on the floor and similarly closes.

BeginnerWork in progress677
Door for Automatic Premises

Things used in this project

Hardware components

SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Industrial Pushbutton Switch, Push-Pull
Industrial Pushbutton Switch, Push-Pull
×2
Arduino UNO
Arduino UNO
×1
Perma-Proto Breadboard Half Size
Perma-Proto Breadboard Half Size
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires

Story

Read more

Code

Untitled file

Arduino
When pressed, a button will open the door and stay that way, until another button is pressed.
#include <Servo.h>
Servo puerta;
int boton1;
int boton2; 

void setup() {
 pinMode(boton1,INPUT);
 pinMode(boton2,INPUT);
 puerta.attach (3);
}

void loop() {
  if(boton1==HIGH)
  { puerta.write(90); 
                }
  else(boton2==HIGH);
  { 
    puerta.write(0);
    }

}

Credits

grecia_salazar1212
0 projects • 0 followers
fabiola0522
1 project • 0 followers

Comments