From 83fefd2404fb2ae81bded05030fb75269334113f Mon Sep 17 00:00:00 2001 From: Ben Sartori <149951068+bensartori@users.noreply.github.com> Date: Sat, 11 May 2024 14:10:16 +0200 Subject: [PATCH] Some documentation improvements --- README.md | 13 +++++++++++-- lednamebadge.py | 1 + photos/bitmap_data_descr.puml | 28 +++++++++++++++------------- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 38eaf7a..7f1acfc 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,13 @@ To reuse the venv again at a later point: sudo dnf install hidapi python3-hidapi python3-pillow python3-pyusb +### Manual link the HID API lib for some Linuxes + +For some distributions there is a discrepancy between the where pyhidapi searches for the lib and where the package +hidapi places it. A simple solution is to link the libraray to the needed place, e.g. + + ln -s /usr/lib/libhidapi-hidraw.so.0 /usr/local/lib/ + ### Required dependencies on Mac Systems sudo easy_install pip @@ -146,7 +153,7 @@ prints the list of builtin icon names, including :happy: :happy2: :heart: :HEART prints some condensed help:
-usage: led-badge-11x44.py [-h] [-t TYPE] [-s SPEED] [-B BRIGHTNESS] [-m MODE] [-b BLINK] [-a ANTS] [-l] MESSAGE [MESSAGE ...]
+usage: led-badge-11x44.py [-h] [-t TYPE] [-H HID] [-s SPEED] [-B BRIGHTNESS] [-m MODE] [-b BLINK] [-a ANTS] [-l] MESSAGE [MESSAGE ...]
 
 Upload messages or graphics to a 11x44 led badge via USB HID.
 Version 0.12 from https://github.com/jnweiger/led-name-badge-ls32
@@ -158,6 +165,7 @@ positional arguments:
 options:
   -h, --help            show this help message and exit
   -t TYPE, --type TYPE  Type of display: supported values are 12x48 or (default) 11x44. Rename the program to led-badge-12x48, to switch the default.
+  -H HID, --hid HID'    Set to 1 to ensure connect via HID API, program will then not fallback to usb.core library
   -s SPEED, --speed SPEED
                         Scroll speed (Range 1..8). Up to 8 comma-separated values
   -B BRIGHTNESS, --brightness BRIGHTNESS
@@ -175,9 +183,10 @@ Example combining image and text:
 
 There are some options defining the default type:
 - use lednamebadge.py directly: default type is 11x44
-- rename lednamebadge.py to something with '12' and use that: default type is 12x48
+- rename lednamebadge.py to something with '12' (e.g. badge12.py) and use that: default type is 12x48
 - use led-badge-11x44.py: default type is 11x44
 - use led-badge-12x48.py: default type is 12x48
+
 For all these options you can override the default type with -t
 
 ### Animations
diff --git a/lednamebadge.py b/lednamebadge.py
index f65c71e..81fd593 100755
--- a/lednamebadge.py
+++ b/lednamebadge.py
@@ -551,6 +551,7 @@ or
                 print("No led tag with vendorID 0x0416 and productID 0x5020 found.")
                 print("Connect the led tag and run this tool as root.")
                 sys.exit(1)
+
             for i in range(int(len(buf)/64)):
                 # sendbuf must contain "report ID" as first byte. "0" does the job here.
                 sendbuf=array('B',[0])
diff --git a/photos/bitmap_data_descr.puml b/photos/bitmap_data_descr.puml
index 7268993..ccd55c6 100644
--- a/photos/bitmap_data_descr.puml
+++ b/photos/bitmap_data_descr.puml
@@ -1,9 +1,11 @@
+' Using .. for three dots / ellipsis, els it would be a dotted line
+
 @startuml bitmap_data_onebyte
 salt
 title One byte
 {#
  { most significant bit 7
- leftmost pixel } | bit 6 | ... | bit 1 | { least significant bit 0
+ leftmost pixel } | bit 6 | .. | bit 1 | { least significant bit 0
  rightmost pixel }
 }
 @enduml
@@ -12,17 +14,17 @@ title One byte
 salt
 title One scene
 {#
- byte 0 == 8 pixel | byte 11 == 8 pixel | byte 22 == 8 pixel | ...
- byte 1 ...        | byte 12 ...        | byte 23 ...        | ...
- byte 2 ...        | byte 13 ...        | byte 24 ...        | ...
- byte 3 ...        | byte 14 ...        | byte 25 ...        | ...
- byte 4 ...        | byte 15 ...        | byte 26 ...        | ...
- byte 5 ...        | byte 16 ...        | byte 27 ...        | ...
- byte 6 ...        | byte 17 ...        | byte 28 ...        | ...
- byte 7 ...        | byte 18 ...        | byte 29 ...        | ...
- byte 8 ...        | byte 19 ...        | byte 30 ...        | ...
- byte 9 ...        | byte 20 ...        | byte 31 ...        | ...
- byte 10 ...       | byte 21 ...        | byte 32 ...        | ...
+ byte 0 == 8 pixel | byte 11 == 8 pixel | byte 22 == 8 pixel | ..
+ byte 1 ...        | byte 12 ...        | byte 23 ...        | ..
+ byte 2 ...        | byte 13 ...        | byte 24 ...        | ..
+ byte 3 ...        | byte 14 ...        | byte 25 ...        | ..
+ byte 4 ...        | byte 15 ...        | byte 26 ...        | ..
+ byte 5 ...        | byte 16 ...        | byte 27 ...        | ..
+ byte 6 ...        | byte 17 ...        | byte 28 ...        | ..
+ byte 7 ...        | byte 18 ...        | byte 29 ...        | ..
+ byte 8 ...        | byte 19 ...        | byte 30 ...        | ..
+ byte 9 ...        | byte 20 ...        | byte 31 ...        | ..
+ byte 10 ...       | byte 21 ...        | byte 32 ...        | ..
 }
 @enduml
 
@@ -30,6 +32,6 @@ title One scene
 salt
 title Complete bitmap data
 {#
- scene 0 == x bytes | ... | scene n == z bytes
+ scene 0 == x bytes | .. | scene n == z bytes
 }
 @enduml