Jürgen Weigert 6 years ago
parent f8ecb26262
commit 11febb93a7
  1. 12
      led-badge-11x44.py
  2. 0
      usb-power.sh

@ -47,6 +47,7 @@
import sys, os, re, time, argparse import sys, os, re, time, argparse
from array import array from array import array
try: try:
if sys.version_info[0] < 3: raise Exception("prefer usb.core with python-2.x because of https://github.com/jnweiger/led-badge-44x11/issues/9")
import pyhidapi import pyhidapi
pyhidapi.hid_init() pyhidapi.hid_init()
have_pyhidapi = True have_pyhidapi = True
@ -194,14 +195,17 @@ font_11x44 = (
0x00, 0x3c, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x6c, 0x60, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x6c, 0x60,
) )
charmap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + \ charmap = u'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + \
'abcdefghijklmnopqrstuvwxyz' + \ u'abcdefghijklmnopqrstuvwxyz' + \
'0987654321^ !"\0$%&/()=?` °\\}][{' + \ u'0987654321^ !"\0$%&/()=?` °\\}][{' + \
"@ ~ |<>,;.:-_#'+* " + "äöüÄÖÜß" u"@ ~ |<>,;.:-_#'+* " + \
u"äöüÄÖÜß"
char_offset = {} char_offset = {}
for i in range(len(charmap)): for i in range(len(charmap)):
char_offset[charmap[i]] = 11 * i char_offset[charmap[i]] = 11 * i
# print(i, charmap[i], char_offset[charmap[i]])
bitmap_preloaded = [ ([],0) ] bitmap_preloaded = [ ([],0) ]
bitmaps_preloaded_unused = False bitmaps_preloaded_unused = False

Loading…
Cancel
Save