-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Added support for TM1637 Seven-Segment Display #10889
Conversation
Hi, can someone please let me know why the sensors build is failing? It says missing header file, however, I have added the library in tasmota/lib/lib_display/. PlatformIO found the library and compiled it fine locally. |
Build Tasmota-sensors does NOT include display libs
You have to decide if the TM1637 is a sensor or a display. Move the lib files accordingly. |
Regarding to this comment in your code. The driver is NOT a sensor it is a display driver.
so please change your driver to a display driver and move the libs to folder |
Using display drivers in build variant "tasmota-sensors" is not possible, so the |
@Jason2866 I think I acted too quickly after your first suggestion. Will revert and change driver to display type. |
TM1638 driver supports the switches and the LEDs (not the the display). So it is not a display device. |
Unfortunately, the lib I depend on for the display part doesn't deal with the sensor part. Probably some kind of merger of the two is required for unifying everything. I can look into that after getting this one up. |
When I try to change the driver type from "sensor" to "display", I find that there is no FUNC_COMMAND callback defined for display drivers. Is there an equivalent callback I can use for display? I do not need FUNC_DISPLAY_EVERY_50_MSECOND and similar callbacks. Note that the TM1637 is not a real I2C device. And I see that currently, the category "Display" is tied to I2C. So we may not be able to treat this TM1637 driver as a 'Display" driver, just like the TM1638 driver. |
Given the above fact that the TM1637, just like the TM1638, isn't an I2C device, can we use this device as a "sensor"? I have moved the lib as per your suggestion, and the CI passed. |
Thx. As this is a display only you'll need to rewrite it as a display driver like I suggest you do not mess with the feature file as your current implementation tries to exceed the range of a 32-bit integer. |
Thanks for the feedback, @arendst . The commands suitable for the TM1637, and implemented by the new driver, are as folllows:
I find that the display driver commands in I can see a couple of solutions -
I would like to take the first option. What do you suggest? |
Try to implement a basic driver first without the extended commands. As there is already a seven segmenet display driver present I expect most command functionality should be implemented already. |
I have, infact, implemented the basic driver first, then with the way @Jason2866 suggested. The existing "seven-segment display driver" for the TM1638 does not do display, as already noted here. There is no support for any kind of basic 7-segment displays in tasmota as of now. And, as I already mentioned, the current seven-segment display driver doesn't do simple numbers. It seems to cater to LCDs and such for graphics. I have been working on a proper display driver implementation like you suggested (using EDIT: You can take a look at the changes here:
I have pushed the latest changes to the driver and merged the current development branch with this PR. |
I have removed the dedicated pins I had added for this module, and I am now using SSPI MOSI ans SSPI SCLK (Software SPI), greatly reducing the number of changes. Doing this eliminated a bug (I introduced, of course) where SPI pins were getting assigned automatically when TM1637 was enabled. I now know why, though :) |
can you please support more than 4 digits? |
Hi, there are 6 digit modules like this one |
Can you please provide a link from another website? aliexpress in currently blocked where I am, unfortunately. |
Hi, thanks for taking care about my request, it's highly highly appreciated. |
@stephan-8266 |
@stephan-8266 |
yes, thats what i saw in the meantime... looks like none of the libs are supporting 6 digits... let me catch some 6 digit display to play around with |
Found this one: https://github.com/bremme/arduino-tm1637 It allows initializing the display module with "number of columns (digits)" (and rows!!) Maybe you can try this when you get your 6-digit display! |
Subsequent to the feature request from @stephan-8266, I have changed the lib to the one I mentioned above (by bremme), and added support for variable number of digits, upto 6, the maximum that the TM1637 supports.
|
I have tested the 6-digit variety using a "home-made" module (since I can't buy these in my country): |
…DisplayText input
@arendst , I am happy to see my first PR merged into Tasmota :) I'm now working on adding "full support" for the TM1638 (buttons, LEDs and Display). A lot of the code in |
After giving it some more thought, I've come to believe that adding a new Does this sound good? |
I have configured the way said in document on lates release. I am able to control 8 7 segment display but not able to operate 8 button and and control the 8 led. Can you please help |
@usrrsr have you compiled your own binary as documented? |
Can you please start a new Discussion and we would start from there ? |
Description:
Added support for TM1637 Seven-Segment Display.
Checklist:
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass