IDEA
The path the timekeeper follows is a twelve-hour circular orbit in general. I wanted to break the notion of timekeeper. In our daily lives, we usually divide time to use it. Three hours, a unit of time to focus on something for me.
Appearance : If the time exists every three hours, to express it in a minimal way, I wanted to disappear the rest of the part except for the quarter area, but still how to solve the visible area of the motor.
Quater, a fragment of time. After a three-hour journey, to start a new three-hour journey, the hour hand returns to the starting point, then drags and rotates the window down.
Process
/*
VID28-05 Motor Control
Controls two stepper motors at once, used to test a VID28-05
concentric shaft motor
Created 24 May 2018
modified 20 Jan 2020
by Tom Igoe
*/
#include <Stepper.h>
#include <RTCZero.h>
//const int stepsPerRevolution = 720; // VID28-05 is 720 steps per revolution
const int stepsPerHour = 720; // Number of steps for a full hour rotation (adjust as needed) // VID28-05 is 720 steps per revolution
const int stepsPerMinute = 720;
// initialize the stepper library.
// Any 8 pins will do. These numbers were used for the MKR Zero form factor:
Stepper hourMotor(stepsPerHour, 7, 8, 9, 10);
Stepper minuteMotor(stepsPerMinute, 2, 3, 4, 5);
int hourSteps = 0;
int minuteSteps = 0;
// motors will move in opposite directions:
int hourDir = -1;
int minuteDir = -1;
RTCZero rtc;
void setup() {
// initialize the serial port:
Serial.begin(9600);
rtc.begin();
// Check if the RTC has lost power and if so, set the time
if (!rtc.isConfigured()) {
rtc.setTime(12, 0, 0); // Set the time to 12:00:00
}
}
void loop() {
int currentHour = rtc.getHours();
int currentMinute = rtc.getMinutes();
// Calculate the desired position for the minute motor based on the current minute
int desiredHourPosition = currentHour * (stepsPerHour / 12);
int desiredMinutePosition = currentMinute * (stepsPerMinute / 60);
// Move the minute motor to the desired position
while (minuteSteps != desiredMinutePosition) {
if (minuteSteps < desiredMinutePosition) {
minuteMotor.step(minuteDir);
minuteSteps++;
} else {
minuteMotor.step(-minuteDir);
minuteSteps--;
}
delayMicroseconds(5000); // Adjust for your desired speed
}
while (hourSteps != desiredHourPosition) {
if (hourSteps < desiredHourPosition) {
hourMotor.step(hourDir);
hourSteps++;
} else {
hourMotor.step(-hourDir);
hourSteps--;
}
delayMicroseconds(5000); // Adjust for your desired speed
}
// [[for a test]] // Move the minute motor
// for (int i=0; i<stepsPerMinute; i++){
// //hypothesis - 720 steps per revolution
// // hourMotor.step(1);
// //minuteMotor.step(1);
// minuteMotor.step(minuteDir);
// delayMicroseconds(5000); //this value determines the speed - higher means more time between steps and therefore slower
// }
// Print the current minute and the minute motor's position to the serial monitor
Serial.print("Current Hour: ");
Serial.println(currentHour);
Serial.print("Current Minute: ");
Serial.println(currentMinute);
Serial.print("Hour Motor Position: ");
Serial.println(hourSteps);
Serial.print("Minute Motor Position: ");
Serial.println(minuteSteps);
delay(1000);
}