Just a simple key stroker. You dont know you need one until you do... :D
It uses a mini servo, a small potentiometer (optional), and any arduino compatible board that can fit inside the box and can handle the servo. I used a cheap Wemos D1 Mini clone. You need 6x3mm bolts (same size as the bolts used in Prusa printers).
Arduino code is included in the print instructions since this website does not allow me to upload the .ino file...
Just use your normal settings. I included a 3mf file for reference.
Arduino code:
Servo myservo;
int pos = 0;
int lowpos = 0;
int highpos = 90;
int servopin = 2;
int potpin = A0;
int ledpin = D7;
int val = 0;
int oval = 0;
int pot = 0;
int servoSpeed = 4;
SimpleTimer timer;
void setup() {
myservo.attach(servopin);
myservo.write(lowpos);
Serial.begin(9600);
timer.setInterval(val);
}
void loop() {
pot = analogRead(potpin);
//Serial.println(pot);
val = map(pot,1,1024,15000,0);
val = val * 1000 / 1000;
if (abs(oval-val) > 1000) {
Serial.println(val);
oval=val;
timer.setInterval(val);
timer.reset();
}
if (timer.isReady()) {
moveServo();
}
}
void moveServo() {
for (pos = highpos; pos >= lowpos; pos -= servoSpeed) {
myservo.write(pos);
delay(15);
Serial.println(pos);
}
for (pos = lowpos; pos <= highpos; pos += servoSpeed) {
myservo.write(pos);
delay(15);
Serial.println(pos);
}
timer.reset();
}
The author hasn't provided the model origin yet.