Adafruit Hysteria Door Knob Knob

Ingredients
Adafruit Metro Mini
MG995 Servo
(2) LiPo 3.7V
10 ohm
47 ohm



Nutrition
1. The "door lock" turns the power on/off.
2. Female charging port would have been more ideal. ~(O_o)~



Recipe
// Arduino Hysteria Door Opener
// Vije Miller

#include <Servo.h>

Servo knob;
int pos = 0;
int start = 0;
int finish = 180;
// delay 5 seconds
int hold = 5000;
int long_hold = 10000;
const int led = 13;

void setup() {
knob.attach(3);
pinMode(led, OUTPUT);
digitalWrite(led, HIGH);
knob.write(start);
delay(hold);
}

void loop() {
// open
for (pos = start; pos <= finish; pos += 1) {
knob.write(pos);
delay(5);
}
digitalWrite(led, LOW);
// wait
delay(hold);
// close
for (pos = finish; pos >= start; pos -= 1) {
knob.write(pos);
delay(5);
}
digitalWrite(led, HIGH);
delay(long_hold);
}

Archive
http://vijemiller.com/index.php?miter=020013184850
http://vijemiller.com/index.php?miter=020008164122
http://vijemiller.com/index.php?miter=020008010142

@VijeMiller
(╯°□°)╯︵ ┻┻