changeset 7:8ceb7e8002e6

Actually allow multiple dots in 7seg
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Wed, 11 May 2016 00:23:40 +0200
parents d56ff430807e
children 7727f354eb7c
files ht16k33_seg.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ht16k33_seg.py	Wed May 11 00:21:33 2016 +0200
+++ b/ht16k33_seg.py	Wed May 11 00:23:40 2016 +0200
@@ -134,7 +134,7 @@
             return
         if not 32 <= ord(char) <= 127:
             return
-        if char == '.' and not self.buffer[index * 2 + 1] & 0b01000000:
+        if char == '.':
             self.buffer[index * 2 + 1] |= 0b01000000
             return
         c = ord(char) * 2 + 32
@@ -142,7 +142,7 @@
         self.buffer[index * 2 + 1] = CHARS[c]
 
     def push(self, char):
-        if char != '.':
+        if char != '.' and not self.buffer[7] & 0b01000000:
             self.scroll()
         self.put(char, 3)