Hourglass
On your display
A countdown timer and a stopwatch with a hundred and fifty grains of sand that actually fall, tumble and heap up. Dial the length on the clock itself, and when the last grain lands the glass cracks and it rings.
- Topic
- Smarthome
- Includes
- Script
Runs on
- Runs on 32×8 (TC001 & DIY) Melodies: the TC001 plays them, a DIY build only with a buzzer.
- Runs on 52×16 (TC002) 52×16 (TC002) version
- Does not run on 32×8 with AWTRIX 3 (TC001 & DIY) Made for AWTRIX NG.
Choose your display in the next step.
Script description
A countdown timer and a stopwatch with a hundred and fifty grains of sand that actually fall, tumble and heap up. Dial the length on the clock itself.
Panels: 52x16 and 32x8, sharing one saved length and one running timer
The sand is real
The glass holds a hundred and fifty-four cells, seventy-seven a bulb, and
every one of them is a grain. Twelve times a second the whole grid takes a
gravity step: a grain with nothing under it drops, a grain landing on another
tumbles off its shoulder, and the side it picks alternates with position so a
heap grows symmetrically instead of leaning.
So the cone that builds in the bottom bulb, the funnel that opens in the top
one and the ragged, shifting surface of both are not drawn — they are only
what the rule does. The timer stays in charge of the amount: each tick works
out how many grains should be left above the waist, takes that many off the
bottom of the upper bulb and feeds them in at the top of the lower one.
Physics shapes the sand, arithmetic counts it, and they cannot drift apart.
The profile is a table rather than a formula. Straight-sided bulbs make a bow
tie; the curve — wide and bulbous at the ends, pinched to a single cell at the
waist — is what reads as blown glass at this size.
Set it on the clock
SELECT opens the dial. LEFT and RIGHT wind it. SELECT starts it. The
length is remembered, so the next time is two presses.
There is no length setting in the configuration at all, deliberately — a
kitchen timer you have to open a browser to change is not a kitchen timer.
The dial gets coarser the higher it goes — thirty seconds at a time under five
minutes, a minute up to half an hour, five minutes to the hour, ten beyond it —
and four quick presses in the same direction make the steps four times bigger,
eight make them ten times. Two hours is a few seconds of pressing; three and a
half minutes is still exact.
One notch below the shortest timer is the stopwatch. It is the same glass
used the way a real sand timer is used when there is no deadline to count
towards: it turns itself over every minute, the case going edge-on and back
over four hundred milliseconds with the sand changing ends while it is too
narrow to see. The sand is the seconds within the minute; the flips you have
watched are the minutes.
It keeps time off screen
Everything lives in the once-a-second tick the firmware runs whether or not
the app is showing, and the deadline is tested against the device clock, not
counted in frames. A timer started and then rotated past keeps perfect time —
and so does one the panel never showed at all.
When it ends the app takes the panel for itself: it brings itself to the
front, holds the rotation so it cannot be carried away mid-ring, and switches
the matrix back on if the clock had gone to sleep. Then the glass cracks,
the fractures racing out from the waist, and shatters into shards and sand
with a bright head chasing round the border behind it.
Any button stops it — left and right as well as select, because an alarm
you can only silence one way is an alarm somebody unplugs.
About left and right
A rotation app should never take them: consume them and the only way out is the
device menu. This one borrows them for the dial only, and three things make
that safe — you opened the dial deliberately, SELECT closes it on the press so
there is never a moment with nothing to press, and eight seconds of no input
closes it by itself. Everywhere else they belong to the carousel.
Other controls
- One press while running — pause; again — resume
- Two presses while running or paused — clear it
- One press while ringing — silence
What to watch for
- The whole panel reddens over the last minute — sand, stream, digits, the
bounce off the glass and the bar along the top, all together. - The digits flare on every tick, and breathe slowly while idle,
because a static panel and a crashed one otherwise look identical. - The colon blinks only while the sand is actually moving.
ENDS 14:32under a running countdown is the wall-clock time it lands
on, which is the one thing a countdown cannot tell you about itself.
(52x16 only — eight rows have one line of text and it is needed elsewhere.)- A glint slides down the glass every few seconds, and an idle one drops a
single grain now and then, so a paused timer never reads as a frozen one. - The sand is drawn grain by grain, shaded by how deep in the heap it sits,
with the topmost cell of every column lit as the sunlit surface.
Settings
Four, and none of them is the timer length.
- Alert tune (chime) — chime, bells, klaxon or pips
- Alert length (45 s) — how long it holds the display before giving up
- Sound (on)
- Wake the display (on) — switch the matrix back on if the clock is asleep
Sign in to view and copy the code of this script.
Discussion 0
Ask a question, suggest a change or share how you use it.
No comments yet. Start the conversation.
Have an idea?
Sign in to ask questions and join the conversation.