pdwerryhouse / max7219_8digit

Micropython driver for the max7219 with 8 x 7segment display
GNU General Public License v3.0
23 stars 7 forks source link

Decimal point improvement #5

Open raplin opened 5 months ago

raplin commented 5 months ago

Doesn't handle decimal point very well; it occupies a whole 7-segment try this (which adds the decimal point to the previous digit):


     def write_to_buffer(self, s):
        inPos=0
        outPos=7
        while inPos<len(s) and outPos>=0:
            c=s[inPos]
            inPos+=1
            if c=='.' and outPos<7:
                self.buffer[outPos+1]|=0x80
                continue
            self.buffer[outPos] = self.decode_char(c)
            outPos-=1
GM-Script-Writer-62850 commented 4 months ago

This could use a reverse option

if you take a max7219 and wire it as labeled this will print right to left