-
Notifications
You must be signed in to change notification settings - Fork 38
Only one device works at a time #61
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
Comments
Hello @akastormseeker , thank you for reporting this. I encountered the very same issue myself when testin two TM1637 displays in Wokwi. I think I found the cause and intend to publish a new release. I wanted to do some physical testing first. Would you perhaps want to assist and test the new code on your TM1650 project? I will publish new code in the master branch shortly and let you know here... |
Okay, reproducing this on hardware was a bit finicky. I used a CH32V003 and two TM1650 displays that shared their DIO pin but have individual CLK pins. When testing your example (modified for two modules) after first testing each display separately, your example worked just fine. But then after power off and on, your example did show that erroneous behavior. As said I've encountered it myself sometime ago in the Wokwi simulation tool. Through debugging I found how that bug was introduced in the last release. I've made a fix and tested it locally in your example and another. Just now I published that fix. |
…to spaces) Failure was introduced when implementing [implicit begin](952e586)
I actually think I figured out the problem. When testing, if you just recompile after commenting out the first one, then they both will work because the first is already initialized/turned on. The problem is the static "fBeginDone" variable in TM16xx:begin(), which applies to ALL instances of the class. I did a test and made it an instance variable and it works perfectly. I can do a pull request this morning if you'd like. |
Hello @akastormseeker, you're absolutely correct. When I encountered the issue, I first thought it was Wokwi specific, After debugging I found that the static variable was indeed the issue. No need for a PR. I already published the fix and published it as a new release (v0.7.2503). It may take a day or so before the new release is picked up by the Arduino IDE, but then you should be notified of the updated release. Assuming this fixes the issue for you as well, I will close this issue as soon as I can confirm it to work in the Wokwi live demo. Thanks again for submitting this issue with such a clear description. It raised my awareness and made me reconsider the importance of fixing this on short notice. |
When using multiple devices (TM1650 in my case), only the first device used works.
My setup:
ESP32C3 micro
4x TM1650 + 4-digit 7-seg displays
Pin D6 connects to all TM1650 data pins
Pins D7-D10 connected to individual clock pins
Code:
Expected behavior:
All displays light up
Actual behavior:
Only disp1 lights up
If I comment out disp1.begin();, then only disp2 lights up
The text was updated successfully, but these errors were encountered: