Stopwatch
On your display
A simple pixel-style stopwatch for AWTRIX 3 written in Berry.
- Topic
- Miscellaneous
- Includes
- Script
Runs on
- Runs on 32×8 (TC001 & DIY)
- Runs on 52×16 (TC002)
- Does not run on 32×8 with AWTRIX 3 (TC001 & DIY) Made for AWTRIX NG.
Choose your display in the next step.
Is this your script?
If you created this script, open your saved edit link to add it to your account. You can then manage it whenever you sign in. Adding it to your account replaces the edit link.
Script description
Update 1.1 The settings menu has been moved up in the code.
FEATURES
- Start / stop / reset using the Select button
- Two display formats:
HH:MM:SS
MM:SS:CC — minutes, seconds and hundredths of a second - Customizable text color
- Real-time hundredths display when using MM:SS:CC
- Automatically centered on the display
- Uses now_ms() for accurate elapsed-time measurement
- Keeps the elapsed time when stopped
- Works swiftly, at 40 fps
SETTINGS
In code look for section ====== START OF USER SETTINGS ======
1. Stopwatch color
self.STOPWATCH_COLOR = 0xFFFFFF
The color uses the 0xRRGGBB format.
Examples:
0xFFFFFF = White
0xFF0000 = Red
0x00FF00 = Green
0x0000FF = Blue
0xFFFF00 = Yellow
2. Display format
self.STOPWATCH_FORMAT = 0
Available formats:
-
0 = HH:MM:SS
-
1 = MM:SS:CC
Example:
00:05:32 -
Format 0 displays hours, minutes and seconds.
-
Format 1 displays minutes, seconds and hundredths of a second:
05:32:47
Here 47 means 47 hundredths of a second (0.47 s).
Controls
The Select button has three functions depending on the current state.
- Start = When the stopwatch is reset, pressing Select starts it.
- Stop = When the stopwatch is running, pressing Select stops it and saves the elapsed time.
- Reset = When the stopwatch is stopped, pressing Select resets the elapsed time to zero.
- After resetting, pressing Select starts the stopwatch again.
P.S. I have no idea how to extend the control of the stopwatch, since my Ulanzi TC001 watch only allows me to set it up like this. I did not find an option to add a continue button. Because it is not possible for me to receive a signal, for example, by pressing the Select button for a long time and it is not possible to assign a reset in this way. Therefore, now there is an opportunity to just start, pause and reset by pressing the Select button.
Accuracy
The stopwatch calculates elapsed time using:
now_ms()
The display in MM:SS:CC mode shows hundredths of a second (00–99).
The internal timer still works with milliseconds; only the displayed value is converted to hundredths.
Display
The current value is automatically centered horizontally using:
text_ink_width(value)
This allows both display formats to remain centered despite having different widths.
GENERAL
The code contains explanations if you want to change something.
Vibecoded with ChatGPT, polished by Avemer.
And I'm a newbie, hope someone might find this script usefull!
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.
More scripts in Miscellaneous
Something wrong with this script? Report it.
Have an idea?
Sign in to ask questions and join the conversation.