From 66e0f462d379b1cb3f42e988eb8ccca614d967d5 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 23 Jun 2024 23:13:34 +0200 Subject: Add test data and working manchester decoder --- barcode_gen.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'barcode_gen.py') diff --git a/barcode_gen.py b/barcode_gen.py index 7dfb677..5a9aa30 100644 --- a/barcode_gen.py +++ b/barcode_gen.py @@ -5,7 +5,7 @@ import itertools import textwrap import click -from reedmuller import reedmuller +from reedmuller.reedmuller import ReedMuller class Tag: @@ -81,15 +81,19 @@ class Tag: @click.argument('outfile', type=click.File('w'), default='-') def cli(data, outfile, height, text, font, font_size, bar_width, margin, color, text_color, dpi): data = int(data, 16) + data &= 0x3ffffff text_color = text_color or color - NUM_BITS = 26 + rm = ReedMuller(3, 5) - data_bits = [bool(data & (1<