-
Notifications
You must be signed in to change notification settings - Fork 152
/
Copy pathdotmatrixtool.py
executable file
·40 lines (31 loc) · 971 Bytes
/
dotmatrixtool.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Richard Hull and contributors
# See LICENSE.rst for details.
# PYTHON_ARGCOMPLETE_OK
"""
Design a bitmap using http://dotmatrixtool.com/#, then paste the generated
hex values over those at lines 21-22.
See https://github.com/rm-hull/luma.led_matrix/issues/170
"""
import time
from demo_opts import get_device
from luma.core.render import canvas
from luma.core import legacy
def main():
MY_CUSTOM_BITMAP_FONT = [
[
0x00, 0x3e, 0x08, 0x3e, 0x00, 0x3e, 0x2a, 0x22,
0x00, 0x3e, 0x20, 0x20, 0x00, 0x3e, 0x0a, 0x0e
]
]
device = get_device()
with canvas(device) as draw:
# Note that "\0" is the zero-th character in the font (i.e the only one)
legacy.text(draw, (0, 0), "\0", fill="white", font=MY_CUSTOM_BITMAP_FONT)
time.sleep(5)
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
pass