@ -6,8 +6,7 @@ Upload tool for an led name tag with USB-HID interface
## Warning
## Warning
There are many different versions of LED Badges on the market.
There are many different versions of LED Badges on the market.
Some even look identical, but are not.
This one uses an USB-HID interface, while others use USB-Serial (see references below).
This one uses an USB-HID interface, while many others use USB-Serial.
The type supported by this project has an array of 44 x 11 LEDs and
The type supported by this project has an array of 44 x 11 LEDs and
identifies itself on the USB as
identifies itself on the USB as
@ -24,41 +23,52 @@ Required dependencies on Debian/Ubuntu Systems:
#### Examples:
#### Examples:
Sudo may or may not be needed for accessing the USB device, depending on your system.
sudo python3 ./led-badge-11x44.py "Hello World!"
sudo python3 ./led-badge-11x44.py "Hello World!"
loads the text 'Hello World!' as the first message, and scrolls it from right to left (default scroll mode=0) and speed 4 (default). After an upload the device shows the first message once and returns to the charging screen if still connected to USB. Either pull the plug or press the small button next to the USB connector.
loads the text 'Hello World!' as the first message, and scrolls it from right to left (default scroll mode=0) and speed 4 (default). After an upload the device shows the first message once and returns to the charging screen if still connected to USB. Either pull the plug or press the small button next to the USB connector.
Sudo may or may not be needed, depending on your system.
loads the text 'Hello' as message one and 'World!' as message two. Compare the difference in quoting to the previous example. Up to 8 messages can be uploaded. This example uses mode 6, which drops the words with a nice little animation vertically into the display area. Speed is set to maximum here, for smoothness.
loads the text 'Hello' as message one and 'World!' as message two. Note the diffrence in quoting. Up to 8 messages can be uploaded. This example uses mode 6, which is dromps the words with a nice little animation vertically into the display area. Speed is set to maximum here, so that the animation is very smooth. Per default you will only see 'Hello'.
Per default you will only see 'Hello'. To see all messages, press the small button next to the USB connector multiple times, until you briefly see 'M1-8'. Now the display loops through all uploaded messages.
To see all messages, press the small button next to the USB connector multiple times, until you briefly see 'M1-8'. Now the display loops through all uploaded messages.
preloads two images, a heart and a crude fablab logo as images 1 and two. The images can then be embedded in a message by using control characters. To enter the ^A control character on the shell, press CTRL-V followed by CTRL-A.
uses one builtin and one loaded image. The heart is builtin, and the fablab-logo is loaded from file. The fablab logo is used twice, once before the word 'fablab' and again behind through the reference ':1:' (which references the first loaded image).
shows a bicycle crossing the display in left-to-right and right-to-left (as a second message). If you select the 'M1-8' mode, the bike permanently runs back and forth the display. You may add a short message to one or both, to make it appear the bike is pulling the text around.
python3 ./led-badge-11x44.py --list-names
prints the list of builtin icon names, including :happy: :happy2: :heart: :HEART: :heart2: :HEART2: :fablab: :bicycle: :bicycle_r: :owncloud: ::
parser=argparse.ArgumentParser(description='Upload messages or graphics to a 44x11 led badge via USB HID. Version %s from https://github.com/jnweiger/led-badge-44x11 -- see there for more examples and for updates.'%__version,epilog="Example combining image and text (enter the ^A character as CTRL-V CTRL-A): sudo %s -p gfx/heart.png I^Ayou"%sys.argv[0])
parser=argparse.ArgumentParser(description='Upload messages or graphics to a 44x11 led badge via USB HID. Version %s from https://github.com/jnweiger/led-badge-44x11 -- see there for more examples and for updates.'%__version,epilog='Example combining image and text: sudo %s"I:HEART2:you"'%sys.argv[0])
parser.add_argument('-s','--speed',default='4',help="Scroll speed. Up to 8 comma-seperated values (range 1..8)")
parser.add_argument('-s','--speed',default='4',help="Scroll speed. Up to 8 comma-seperated values (range 1..8)")
parser.add_argument('-p','--preload',metavar='FILE',action='append',help="Load bitmap images. Use ^A, ^B, ^C, ... in text messages to make them visible")
parser.add_argument('-p','--preload',metavar='FILE',action='append',help="Load bitmap images. Use ^A, ^B, ^C, ... in text messages to make them visible. Deprecated, embed within ':' instead")
parser.add_argument('message',metavar='MSG_OR_FILENAME',nargs='+',help="Up to 8 message texts or image file names")
parser.add_argument('-l','--list-names',action='version',help="list named icons to be embedded in messages and exit",version=':'+': :'.join(bitmap_named.keys())+': :: or e.g. :path/to/some_icon.png:')
parser.add_argument('message',metavar='MESSAGE',nargs='+',help="Up to 8 message texts with embedded builtin icons or loaded images within colons(:) -- See -l for a list of builtins")