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

How do you control the TM1638 discrete LEDS? #47

Open
zapdogster opened this issue Feb 21, 2024 · 2 comments
Open

How do you control the TM1638 discrete LEDS? #47

zapdogster opened this issue Feb 21, 2024 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@zapdogster
Copy link

More TM1638 libraries I've seen have functions to drive the row of discrete LEDs that are along the top of the board. I don't see an equivalent in this library. Am I missing something?

@maxint-rd maxint-rd self-assigned this Feb 21, 2024
@maxint-rd maxint-rd added the question Further information is requested label Feb 21, 2024
@maxint-rd
Copy link
Owner

Hello @zapdogster , it kind of depends on the module that you're using. Can I assume your module is labeled LED&KEY has 8 buttons below the digits and 8 discrete red LEDs above the digits?

Note that there are a few different display modules, all featuring the TM1638 chip. Some modules look similar but may have different wiring. My first module is the LED&KEY module mentioned above. I believe there is also a similar LED&KEY module having 8 discrete bi-color red/green LEDs above the digits. I also have a module labeled QYF-TM1638 that has 4x4 buttons, without discrete LED's. The is also a module with different wiring, using common anode digits instead of common cathode.

This library has its origin in the library by rjbatista, which explains why some basic examples and documentation may be lacking. For the discrete LEDs the methods setLED() and setLEDs() are implemented:

    /** Set the LED at pos to color (TM1638_COLOR_RED, TM1638_COLOR_GREEN or both) */
    virtual void setLED(byte color, byte pos);
    /** Set the LEDs. MSB byte for the green LEDs, LSB for the red LEDs */
    virtual void setLEDs(word led);

If you want to drive individual digit LEDs you can also try the method setSegments16().

@zapdogster
Copy link
Author

Thanks for the reply. Yes the module I have is the one you describe as "LED&KEY". I will give those methods you have listed a try. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants