diff options
author | Ben Gardiner <ben.l.gardiner@gmail.com> | 2020-11-22 20:43:01 +0000 |
---|---|---|
committer | Gerhard Sittig <gerhard.sittig@gmx.net> | 2021-01-13 20:18:56 +0100 |
commit | 853653aa7bf59ee570a36b4e15211d5a653c1b95 (patch) | |
tree | 230990e6932e03d17bd74b91e33a5ae27adf0241 /decoders | |
parent | 45d3b17726ff9dae899dbd2b23d9b87f357558a8 (diff) | |
download | libsigrokdecode-853653aa7bf59ee570a36b4e15211d5a653c1b95.tar.gz libsigrokdecode-853653aa7bf59ee570a36b4e15211d5a653c1b95.zip |
seven_segment: expand to a full alphabet
Expand the list of characters that will be recognized by the seven
segment decoder to include many display character 'encodings.'
Including some punctuation characters and tricky letters like W and V.
Signed-off-by: Ben Gardiner <ben.l.gardiner@gmail.com>
[ gsi: sort by ASCII codes (keep ignoring letter case) ]
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/seven_segment/pd.py | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/decoders/seven_segment/pd.py b/decoders/seven_segment/pd.py index eedacf9..d090cff 100644 --- a/decoders/seven_segment/pd.py +++ b/decoders/seven_segment/pd.py @@ -24,6 +24,13 @@ class ChannelError(Exception): digits = { (0, 0, 0, 0, 0, 0, 0): ' ', + (0, 1, 0, 0, 0, 1, 0): '"', + (1, 1, 0, 1, 1, 1, 1): "&", + (0, 0, 0, 0, 0, 1, 0): "'", + (0, 1, 0, 0, 0, 0, 0): "'", + (0, 0, 1, 1, 0, 0, 0): ',', + (0, 0, 0, 0, 0, 0, 1): '-', + (0, 0, 0, 0, 1, 0, 0): '.', (1, 1, 1, 1, 1, 1, 0): '0', (0, 1, 1, 0, 0, 0, 0): '1', (1, 1, 0, 1, 1, 0, 1): '2', @@ -31,15 +38,53 @@ digits = { (0, 1, 1, 0, 0, 1, 1): '4', (1, 0, 1, 1, 0, 1, 1): '5', (1, 0, 1, 1, 1, 1, 1): '6', + (1, 1, 1, 0, 0, 1, 0): '7', (1, 1, 1, 0, 0, 0, 0): '7', (1, 1, 1, 1, 1, 1, 1): '8', (1, 1, 1, 1, 0, 1, 1): '9', + (1, 0, 0, 0, 0, 0, 1): '=', + (0, 0, 0, 1, 0, 0, 1): '=', + (1, 1, 0, 0, 1, 0, 1): '?', (1, 1, 1, 0, 1, 1, 1): 'A', - (0, 0, 1, 1, 1, 1, 1): 'B', + (1, 1, 1, 1, 1, 0, 1): 'a', + (0, 0, 1, 1, 1, 1, 1): 'b', (1, 0, 0, 1, 1, 1, 0): 'C', - (0, 1, 1, 1, 1, 0, 1): 'D', + (0, 0, 0, 1, 1, 0, 1): 'c', + (0, 1, 1, 1, 1, 0, 1): 'd', (1, 0, 0, 1, 1, 1, 1): 'E', (1, 0, 0, 0, 1, 1, 1): 'F', + (1, 0, 1, 1, 1, 1, 0): 'G', + (0, 1, 1, 0, 1, 1, 1): 'H', + (0, 0, 1, 0, 1, 1, 1): 'h', + (0, 0, 0, 0, 1, 1, 0): 'I', + (1, 0, 0, 0, 1, 0, 0): 'i', + (0, 0, 1, 0, 0, 0, 0): 'i', + (0, 1, 1, 1, 1, 0, 0): 'J', + (0, 1, 1, 1, 0, 0, 0): 'J', + (1, 0, 1, 1, 0, 0, 0): 'j', + (1, 0, 1, 0, 1, 1, 1): 'K', + (0, 0 ,0, 1, 1, 1, 0): 'L', + (1, 0, 1, 0, 1, 0, 0): 'M', + (1, 0, 1, 0, 1, 0, 1): 'M', + (1, 1, 1, 0, 1, 1, 0): 'N', + (0, 0, 1, 0, 1, 0, 1): 'n', + (0, 0, 1, 1, 1, 0, 1): 'o', + (1, 1, 0, 0, 1, 1, 1): 'p', + (1, 1, 1, 0, 0, 1, 1): 'q', + (1, 1, 0, 0, 1, 1, 0): 'R', + (0, 0, 0, 0, 1, 0, 1): 'r', + (0, 0, 0, 1, 1, 1, 1): 't', + (0, 0, 1, 1, 1, 0, 0): 'u', + (0, 1, 0, 1, 0, 1, 0): 'V', + (0, 1, 0, 0, 1, 1, 1): 'V', + (0, 1, 1, 1, 1, 1, 0): 'V', + (0, 1, 0, 0, 0, 1, 1): 'v', + (0, 1, 0, 1, 0, 1, 1): 'W', + (0, 0, 1, 0, 1, 0, 0): 'x', + (0, 1, 1, 1, 0, 1, 1): 'y', + (1, 1, 0, 1, 1, 0, 0): 'Z', + (1, 1, 0, 0, 0, 1, 0): '^', + (0, 0, 0, 1, 0, 0, 0): '_', } class Decoder(srd.Decoder): |