TM1637 icon indicating copy to clipboard operation
TM1637 copied to clipboard

Add Colon support

Open bastiengrignon opened this issue 3 years ago • 5 comments

Adding a new feature to support usage of colon (see new example)

@avishorp this could be interesting to have a new feature to this library

bastiengrignon avatar Apr 28 '21 04:04 bastiengrignon

@bastiengrignon I like this request. It can be used in my project. Thanks.

riraosan avatar Apr 28 '21 06:04 riraosan

I'm actually using a modified version of your library for years but didn't think and took the time to make it a new feature for others.

Time has come 😄

bastiengrignon avatar Apr 28 '21 06:04 bastiengrignon

I'm actually using a modified version of your library for years but didn't think and took the time to make it a new feature for others.

Time has come 😄

hi, have tested your version support dot with your TM1637Colon exemple don't work correctly with dot on -> "16:45" without dot -> "18 45"

correction : change "writeByte(segments[k] | 0x7f); // Set colon OFF" by -> "writeByte(segments[k] & ~0x80); // Set colon OFF" in your "TM1637Display::setSegments" (line 111)

stef-ladefense avatar May 06 '21 12:05 stef-ladefense

I'm actually using a modified version of your library for years but didn't think and took the time to make it a new feature for others.

Time has come 😄

see https://github.com/stef-ladefense/TM1637

stef-ladefense avatar May 06 '21 21:05 stef-ladefense

In the design of the library, I tried to keep it as stateless as possible (with brightness being the only exception). Your suggestion contradicts this principle. Moreover, setSegments just sends the value to the display, setting the colon on or off is just a matter of setting the right bits, there is no need for a special function to do that.

avishorp avatar May 30 '21 20:05 avishorp