Automated 7 Segment mechanical counter
Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.
Zapisane na tym urządzeniu.
Automated 7 Segment mechanical counter with servo
- Ocena
- 0 / 5
- Polubienia
- 25
- Pobrania
- 106
- Wydruki
- 0
- Wyświetlenia
- 1604
- Oceny
- 0
Aktualizacja u źródła:
Informacje o modelu
- Źródło
- Printables
- Kategoria
- Other Ideas
- Licencja
- Creative Commons — Attribution — Noncommercial — Share Alike
Components
Standard pieces
You will need to print the standard part of the 7 Segment Mechanical Counter.
You also can use tigh tolerences part from my previous remix.
Custom pieces
You need the backplate and the push action from this model.
Tips: Print the push action on it's side with tupport to have smooth surfaces.
Servo
This model is optimized for a mg995 servo
Servo horn
I've used this horn for the servo.
Microcontroller
The code that follow is for an ESP32 but you are free to use what you want.
Code
I've based the servo control from this video.
First version, going through all the number
// Import ESP32Servo library, don't forget to install it. https://madhephaestus.github.io/ESP32Servo/annotated.html
#include <ESP32Servo.h>// Initiate the variables
Servo myServo;
int count = 0;
int wantedCount = 0;
// Setup servo and serial communication
void setup() {
myServo.attach(13);
Serial.begin(115200);
}
void loop() {
nextDigit();
}
// Function making the servo go down, then go up
void nextDigit() {
myServo.write(100);
delay(500);
myServo.write(170);
delay(500);
}
Second version, select a specific number to go to
// Import ESP32Servo library, don't forget to install it. https://madhephaestus.github.io/ESP32Servo/annotated.html
#include <ESP32Servo.h>
// Initiate the variables
Servo myServo;
int count = 0;
int wantedCount = 0;
// Setup servo and serial communication
void setup() {
myServo.attach(13);
Serial.begin(115200);
}
void loop() {
// Read the integer value from serial input, make sure to input a number between 0 and 9
if (Serial.available() > 0) {
wantedCount = Serial.parseInt();
}
// Move the servo until the count matches the wantedCount
while (count != wantedCount) {
// Trigger the servo
nextDigit();
count++;
// Loop back to 0 when hiting 10
if (count == 10) {
count = 0;
}
Serial.println("wanted: " + String(wantedCount));
Serial.println("current: " + String(count));
}
}
// Function making the servo go down, then go up
void nextDigit() {
myServo.write(100);
delay(500);
myServo.write(170);
delay(500);
}