Firmware flow
Run an elapsed-time motor sequence
Selected motor fragment from a clock-and-servo firmware variant.
When the interval has elapsed, the firmware drives the motor for a blocking duration, stops it, advances a software position count and chooses the next direction from the count bounds.
This is elapsed-time, open-loop motion logic. The position count and comments are not measured travel, calibrated positioning or evidence of tested actuator operation.
Read the implementation
Selected firmware excerpt. The diagram explains the code; it is not a hardware test.
Selected source excerpt
// Linear actuator logic
if (currentMillis - lastMoveTime >= MOVE_INTERVAL) {
lastMoveTime = currentMillis;
moveMotor(direction);
delay(MOVE_TIME);
stopMotor();
position += direction;
if (position >= 15) {
direction = -1;
} else if (position <= 0) {
direction = 1;
}
}Technical notes
Clock and servo outputs
The selected variant reads the DS1302 through a three-wire interface and derives servo commands from the hour and minute. Serial is used for diagnostic output.
Timed actuator movement
A separate millis()-based interval starts the motor, waits for the configured drive duration and stops it. The firmware updates a software position count and reverses direction at its count limits.
Open-loop estimates
The actuator position is estimated from timed commands, with no measured position or end-stop feedback in this source. Blocking delays and integer mapping also limit the implementation; calibrated travel and clock-display accuracy are not established.
