Mimic Chest (From Dark Souls)
by alexc120 in Workshop > 3D Printing
138 Views, 0 Favorites, 0 Comments
Mimic Chest (From Dark Souls)
Mimic from Dark Souls
Supplies
3mm MDF wood
Arduino
9v battery
servo
resister
various wires
button
3d print
tape
wood glue
Print and Make Box
Print off the box using a laser cutter and 3mm MDF wood.
Downloads
3d Print Tongue & Stand
Use a 3d printer to print the young and stand to hold the servo. (if you need to you can trim stuff to make it fit and use tape to hold it together.
Put All the Parts Together
connect the battery, servo, and button to the Arduino. Plug the servo into the number 9 slot and plug the button into the number 2 slot. connect the battery to the 5v and ground plugs and it should work. Tape the servo onto the stand and tape the stand to the bottom of the box. Take the tongue and screw it onto the servo so that it can mimic a mimic. After this, it should be finished. you can make any changes you want to make it how you want it.
<iframe src=https://create.arduino.cc/editor/alexchappell/0fcecd54-a346-4b7c-8480-8a2db873f481/preview?embed style="height:510px;width:100%;margin:10px 0" frameborder=0></iframe>
#include <Servo.h>
Servo servoOne; // Names the first servo
int posOne = 175; // Creates a variable for a starting position. Can be set to a different starting position.
int count = 0;
// This function will rotate servoOne in the direction specified to the position defined on lines 10 or 15.
void servoRotate(String ch) {
int rotate_max = 180; // Set your maximum rotation here. Mechanical max limitation is 180.
int rotate_min = 0; // Set your minimum rotation here. Mechanical min limitation is 0.
if (ch == "CW") {
if (posOne <= rotate_max) {
posOne = 45; // Increment position for CCW rotation (adjust as needed)
Serial.print("Servo1 Rotate CCW to ");
Serial.print(posOne);
}
} else if (ch == "CCW") {
if (posOne >= rotate_min) {
posOne = 175; // Decrement position for CW rotation (adjust as needed)
Serial.print("Servo1 Rotate CW to ");
Serial.print(posOne);
}
}
// Tell servoOne to move to the new position
servoOne.write(posOne);
Serial.println(" degrees");
delay(30); // Mechanical limitation to the frequency of commands given.
}
void setup() {
Serial.begin(9600);
// Setup pin modes
pinMode(2, INPUT);
// Servo Setup
servoOne.attach(9); // Attaches servoOne to pin 9 - servos MUST be attached to PWM pins
servoOne.write(posOne); // Moves servoOne to the starting position defined on line 40. Can be removed to not rotate servo when turning on.
}
void loop() {
// Read button
bool currentState = digitalRead(2);
static bool pressed = false;
if (currentState != pressed) {
// Button state changed
delay(500);
pressed = currentState;
if (currentState == HIGH) {
// Button pressed
if (count == 0) {
servoRotate("CW");
count = 1;
} else {
servoRotate("CCW");
count = 0;
}
delay(1500);
}
}
}
What I Would Change
I would add more cosmetics to the exterior of the box to make it look better. I would also add a better way to press the button to make it work and add another servo to have a top on the box.