From 11febb93a77e70188c4c1fb4e0d72dcf21ca1b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Weigert?= Date: Mon, 27 May 2019 00:10:22 +0200 Subject: [PATCH] fixed https://github.com/jnweiger/led-badge-44x11/issues/9 --- led-badge-11x44.py | 12 ++++++++---- usb-power.sh | 0 2 files changed, 8 insertions(+), 4 deletions(-) mode change 100644 => 100755 usb-power.sh diff --git a/led-badge-11x44.py b/led-badge-11x44.py index a1573ba..4cf6b5a 100755 --- a/led-badge-11x44.py +++ b/led-badge-11x44.py @@ -47,6 +47,7 @@ import sys, os, re, time, argparse from array import array 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 pyhidapi.hid_init() have_pyhidapi = True @@ -194,14 +195,17 @@ font_11x44 = ( 0x00, 0x3c, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x6c, 0x60, ) -charmap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + \ - 'abcdefghijklmnopqrstuvwxyz' + \ - '0987654321^ !"\0$%&/()=?` °\\}][{' + \ - "@ ~ |<>,;.:-_#'+* " + "äöüÄÖÜß" +charmap = u'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + \ + u'abcdefghijklmnopqrstuvwxyz' + \ + u'0987654321^ !"\0$%&/()=?` °\\}][{' + \ + u"@ ~ |<>,;.:-_#'+* " + \ + u"äöüÄÖÜß" char_offset = {} for i in range(len(charmap)): char_offset[charmap[i]] = 11 * i + # print(i, charmap[i], char_offset[charmap[i]]) + bitmap_preloaded = [ ([],0) ] bitmaps_preloaded_unused = False diff --git a/usb-power.sh b/usb-power.sh old mode 100644 new mode 100755