Clock_M - Customizable Pixel Clock
A medium pixel-style HH clock for AWTRIX 3 with customizable color and blinking colon.
| System | AWTRIX NG Scripts |
|---|---|
| Firmware | AWTRIX NG |
| Topic | Miscellaneous |
| Built by | Avemer |
| File | skzUJCXa4l7g.ax · 5.1 KB |
| Icons | — |
| Published | 9 Aug 2026 · updated 9 Aug 2026 |
| Downloads | 1 |
FEATURES
- Medium 5×7 pixel digits
- 24 HH time format
- Centered on the 32×8 AWTRIX display
- Customizable clock color
- Optional blinking colon
- Colon blinks once per second when enabled
- Designed specifically for AWTRIX 3 Berry scripting
SETTINGS
The main settings can be changed near the top of the script:
- var BLINK_COLON
- var CLOCK_COLOR
BLINK_COLON
Controls whether the : blinks.
self.BLINK_COLON = 1
1 = colon blinks once per second
0 = colon stays permanently visible
CLOCK_COLOR
Controls the color of the clock.
The color is specified as a hexadecimal RGB value:
self.CLOCK_COLOR = 0xFFFFFF
Examples:
0xFFFFFF # White
0xFF0000 # Red
0x00FF00 # Green
0x0000FF # Blue
0xFFFF00 # Yellow
0x00FFFF # Cyan
0xFF00FF # Magenta
You only need to change these settings; the rest of the script can remain unchanged.
Display
The clock displays the current time using large custom pixel digits:
HH:MM
The script uses the AWTRIX draw() loop, so the display updates automatically.
GENERAL
The code contains explanations if you want to change something.
The design of each digit and colon is written in the code and can be changed manually, as well as their position.
Vibecoded with ChatGPT, polished by Avemer.
And I'm a newbie, hope someone might find this script usefull!
skzUJCXa4l7g.ax
# @name Clock_M
# @desc Big pixel clock HH:MM
# @author Avemer
# @version 1.0
class BigClock
var BLINK_COLON
var CLOCK_COLOR
def init()
# COLON SETTINGS
# 1 = colon blinks
# 0 = colon is always on
self.BLINK_COLON = 1
# Clock Color
# 0xFFFFFF = White
# 0xFF0000 = Red
# 0x00FF00 = Green
# 0x0000FF = Blue
# 0xFFFF00 = Yellow
# 0x00FFFF = Cyan
# 0xFF00FF = Purple
self.CLOCK_COLOR = 0xFFFFFF
end
# LOOP
# The screen updates draw() automatically.
def loop()
end
# DRAWING A SINGLE PIXEL
# x = horizontal coordinate
# y = vertical coordinate
# In reality, we add +1 to Y,
# so all digits are shifted down by one line.
# AWTRIX Screen = 32 x 8 pixels.
def p(x, y)
pixel(x, y + 1, self.CLOCK_COLOR)
end
# DRAWING A DIGIT
# x = left coordinate of the digit
# n = which digit to draw: 0..9
# Each digit is 6 x 7 pixels in size.
# Relative coordinates:
# x+0 x+1 x+2 x+3 x+4
#
# y=0 █ █ █ █ █
# y=1 █ █ █ █ █
# y=2 █ █ █ █ █
# y=3 █ █ █ █ █
# y=4 █ █ █ █ █
# y=5 █ █ █ █ █
# y=6 █ █ █ █ █
# p() then automatically adds +1 to Y.
def digit(x, n)
# DIGIT 0
if n == 0
self.p(x+1,0)
self.p(x+2,0)
self.p(x+3,0)
self.p(x,1)
self.p(x+4,1)
self.p(x,2)
self.p(x+4,2)
self.p(x,3)
self.p(x+4,3)
self.p(x,4)
self.p(x+4,4)
self.p(x,5)
self.p(x+4,5)
self.p(x+1,6)
self.p(x+2,6)
self.p(x+3,6)
# DIGIT 1
elif n == 1
self.p(x+1,1)
self.p(x+2,0)
self.p(x+2,1)
self.p(x+2,2)
self.p(x+2,3)
self.p(x+2,4)
self.p(x+2,5)
self.p(x,6)
self.p(x+1,6)
self.p(x+2,6)
self.p(x+3,6)
self.p(x+4,6)
# DIGIT 2
elif n == 2
self.p(x,1)
self.p(x+1,0)
self.p(x+2,0)
self.p(x+3,0)
self.p(x+4,1)
self.p(x+4,2)
self.p(x+1,3)
self.p(x+2,3)
self.p(x+3,3)
self.p(x,4)
self.p(x,5)
self.p(x,6)
self.p(x+1,6)
self.p(x+2,6)
self.p(x+3,6)
self.p(x+4,6)
# DIGIT 3
elif n == 3
self.p(x,1)
self.p(x+1,0)
self.p(x+2,0)
self.p(x+3,0)
self.p(x+4,1)
self.p(x+4,2)
self.p(x+1,3)
self.p(x+2,3)
self.p(x+3,3)
self.p(x+4,4)
self.p(x+4,5)
self.p(x,5)
self.p(x+1,6)
self.p(x+2,6)
self.p(x+3,6)
# DIGIT 4
elif n == 4
self.p(x,3)
self.p(x+1,2)
self.p(x+2,1)
self.p(x+3,0)
self.p(x,4)
self.p(x+1,4)
self.p(x+2,4)
self.p(x+3,4)
self.p(x+4,4)
self.p(x+3,1)
self.p(x+3,2)
self.p(x+3,3)
self.p(x+3,4)
self.p(x+3,5)
self.p(x+3,6)
# DIGIT 5
elif n == 5
self.p(x,0)
self.p(x+1,0)
self.p(x+2,0)
self.p(x+3,0)
self.p(x+4,0)
self.p(x,1)
self.p(x,2)
self.p(x+1,3)
self.p(x+2,3)
self.p(x+3,3)
self.p(x+4,4)
self.p(x+4,5)
self.p(x,6)
self.p(x+1,6)
self.p(x+2,6)
self.p(x+3,6)
# DIGIT 6
elif n == 6
self.p(x+1,0)
self.p(x+2,0)
self.p(x+3,0)
self.p(x+4,1)
self.p(x,1)
self.p(x,2)
self.p(x,3)
self.p(x,4)
self.p(x,5)
self.p(x+1,3)
self.p(x+2,3)
self.p(x+3,3)
self.p(x+4,4)
self.p(x+4,5)
self.p(x+1,6)
self.p(x+2,6)
self.p(x+3,6)
# DIGIT 7
elif n == 7
self.p(x,0)
self.p(x+1,0)
self.p(x+2,0)
self.p(x+3,0)
self.p(x+4,0)
self.p(x+4,1)
self.p(x+4,2)
self.p(x+3,3)
self.p(x+2,4)
self.p(x+2,5)
self.p(x+2,6)
# DIGIT 8
elif n == 8
self.p(x+1,0)
self.p(x+2,0)
self.p(x+3,0)
self.p(x,1)
self.p(x+4,1)
self.p(x,2)
self.p(x+4,2)
self.p(x+1,3)
self.p(x+2,3)
self.p(x+3,3)
self.p(x,4)
self.p(x+4,4)
self.p(x,5)
self.p(x+4,5)
self.p(x+1,6)
self.p(x+2,6)
self.p(x+3,6)
# DIGIT 9
elif n == 9
self.p(x+1,0)
self.p(x+2,0)
self.p(x+3,0)
self.p(x,1)
self.p(x+4,1)
self.p(x,2)
self.p(x+4,2)
self.p(x+1,3)
self.p(x+2,3)
self.p(x+3,3)
self.p(x+4,4)
self.p(x+4,5)
self.p(x,5)
self.p(x+1,6)
self.p(x+2,6)
self.p(x+3,6)
end
end
# COLON :
# x = horizontal coordinate of the colon
# Two dots are used:
# top dot = Y 2
# bottom dot = Y 4
# Function p() adds +1 to Y,
# so they are actually in rows 3 and 5.
def colon(x)
# If blinking is enabled
if self.BLINK_COLON == 1
var s = second()
# Even second — show it
if s % 2 == 0
self.p(x,1)
self.p(x+1,1)
self.p(x,2)
self.p(x+1,2)
self.p(x,4)
self.p(x+1,4)
self.p(x,5)
self.p(x+1,5)
end
# If blinking is disabled — show it constantly
else
self.p(x,1)
self.p(x+1,1)
self.p(x,2)
self.p(x+1,2)
self.p(x,4)
self.p(x+1,4)
self.p(x,5)
self.p(x+1,5)
end
end
# MAIN CLOCK DRAWING
def draw()
clear()
# GET CURRENT TIME
var h = hour()
var m = minute()
# SPLIT HOURS AND MINUTES INTO INDIVIDUAL DIGITS
# For example:
# 23:47
# h = 23
# m = 47
# h1 = 2
# h2 = 3
# m1 = 4
# m2 = 7
var h1 = int(h / 10)
var h2 = h % 10
var m1 = int(m / 10)
var m2 = m % 10
# POSITIONS ON SCREEN
# Screen: 32 x 8 pixels
# Hours — first digit
self.digit(1, h1)
# Hours — second digit
self.digit(8, h2)
# Colon
self.colon(15)
# Minutes — first digit
self.digit(19, m1)
# Minutes — second digit
self.digit(26, m2)
end
# BUTTON
def on_button(btn)
end
end
return BigClock()
Install it on your AWTRIX NG
Your browser writes the script straight to the device on your network. It joins the app rotation right away.
Some browsers refuse to talk to a device on your network from a public page. Download the flow and paste it into the Scripts tab of your device, or install it from a terminal:
More flows for AWTRIX NG Scripts or Miscellaneous
Something wrong with this flow? Report it.