Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced TM1650 with 7-Segment commands like TM1637 #18109

Merged
merged 2 commits into from
Mar 12, 2023

Conversation

gablau
Copy link
Contributor

@gablau gablau commented Mar 4, 2023

Description:

Improved TM1650 with 7-segment commands like TM1637
I ported all 7-segment commands into this driver with a bit of refactoring, simplified operation and future extensions by display type, currently only supports:
DisplayType 0 for XY-Clock
DisplayTypo 2 for 303WifiLC01

Bonus:

  • the colon in DisplayMode 1 to 3 now flashes every second.
  • in DisplayMode 3 (time/date), it is possible to increase the time display time using the DisplayRefresh [1..7] command

I tested everything with XY-Clock hardware, I don't have the 303WiFiLC01 clock

If this PR is merged, I intend to update the documentation, as at the moment the "20/TM1650" display driver is not documented

Unfortunately I can't test it against ESP32 but compiling via platform.io works fine

Related issue (if applicable): See discussion #15788

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.4.9
  • The code change is tested and works with Tasmota core ESP32 V.2.0.7
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@Jason2866
Copy link
Collaborator

@gablau Digit colon is wrong for 303WifiLC01
IMG_20230307_111620

@Jason2866 Jason2866 marked this pull request as draft March 7, 2023 10:18
@gablau
Copy link
Contributor Author

gablau commented Mar 7, 2023

Hi @Jason2866 ,
I don't have a 303WiFiLC01 to experiment with, but I traced this type of segment wiring from the source code.
In the byte that is sent to the display these are the bits that turn on the segments.
XY-Clock: PGFEDCBA
303 Wifi: BFAEDCGP

/*        A
 *       ---
 *   F |     | B
 *     |  G  |
 *       ---
 *   E |     | C
 *     |  D  |
 *       ---    ° P
 */     

I apply the position swap before sending it to the display, in the "swapbits" function.
If you could do a few more tests and get me the results, I could fix that.
Are you sure you used the DisplayType 2 command before sending commands to the display?

The only command that doesn't use the swapbits function is DisplayRaw, To be used after putting the display in DisplayMode 0
Could you send these two commands and show me what display shows for each one?

DisplayRaw 0, 4, 1, 2, 4, 8
DisplayRaw 0, 4, 16, 32, 64, 128

Each of these commands should light one segment of each digit on the display.

Best Regards
Gabriele

@Jason2866
Copy link
Collaborator

Jason2866 commented Mar 7, 2023

Yes, DisplayType 2 the pictures of the raw command
8D99432F-CF74-491A-8C0E-8455C81959A2
A15B4313-6F0E-4EF2-9427-4D8103A62F19

The first pictures should show 11:15 So following your drawing "G" should be Double Point.
@gablau

@gablau
Copy link
Contributor Author

gablau commented Mar 7, 2023

If the 11:15 time was correct, I think it's just a problem of dots.

Without sending me the pictures, could you try to see if the numbers are displayed correctly with:

DisplayText 0000
DisplayText 1111
DisplayText 2222
DisplayText 3333
DisplayText 4444
DisplayText 5555
DisplayText 6666
DisplayText 7777
DisplayText 8888
DisplayText 9999

or

DisplayScrollDelay 10
DisplayScrollText 0123456789

Then if possible show me displaytext _._._._., this is mine:
_ _ _ _

Thank you

@Jason2866
Copy link
Collaborator

Jason2866 commented Mar 8, 2023

Hi, the issue is just with the dots. All numbers are shown correct
displaytext _._._._.
IMG_20230308_141350

@gablau
Copy link
Contributor Author

gablau commented Mar 9, 2023

Fixed, it should work now. I had moved segment P wrong, which became G.

@gablau gablau marked this pull request as ready for review March 9, 2023 22:31
@Jason2866
Copy link
Collaborator

@gablau Verified working now for the 303WiFiLC01 module. Thx for the PR!

@arendst arendst merged commit 7f64b6e into arendst:development Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants