Skip to content
Ricardo Batista edited this page Jul 6, 2016 · 3 revisions

TM1638/TM1640 library

A library for interacting an arduino with a TM1638 or a TM1640.

  • Support for the TM1638 and TM1640;
  • Support for common anode TM1638 module (QYF-TM1638);
  • Helper methods for displaying numbers in decimal, hexadecimal and binary;
  • Support for multiple chained TM1638;
  • Reading simultaneous button presses;
  • Support for dimming the display and LEDs;
  • Support for writing text;
  • Support for module in inverted position;
  • Examples for using the library with multiple TM1638 and with a TM1640.

Author

Ricardo Batista

Portugal

See:

Library example usage video

Text scroller example video

Text scroller with several different TM1638 modules

TM1638 Display/LED module (Red display) (older link)

TM1638 Display/LED module (Green display) (older link)

TM1640 module (older link)

This library is done as an hobby and it's free for everybody to use.
You can contribute to the project by using it (drop me a line if you're doing something with it :) ), submitting ideas or donating via Paypal:

Changes:

Version 2.2.0 released:

  • support for common anode TM1638 module (QYF-TM1638);

Version 2.1.3 released:

  • added a define TM1638_COLOR_NONE for clarity when clearing a single LED (issue #26).

Version 2.1.2 released:

  • corrected setDisplayDigit repeatedly with the dot set to true (issue #22);
  • correction on setDisplayToDecNumber bug (thanks to hbx3485) (issue #24).

Version 2.1.1 released:

  • problems on clearDisplay and setupDisplay (issue #21).

Version 2.1.0 released:

  • support for negative decimal numbers (issue #20);
  • corrected setDisplayToString dot bug (issue #19).

Version 2.0.1 released:

  • backwards compatibility with previous Arduino IDE - pure virtual functions were not supported (issue #15);
  • corrected problem with setLEDs() caused by changes in the previous version (issue #18).

Version 2.0.0 released:

  • support for the TM1640;
  • restructuring for supporting other modules.
    • WARNING: some restructuring for supporting the TM1640 but code for older versions using the TM1638 shouldn't be affected

Version 1.6.0 released:

  • support for starting position on setDisplayToString() methods (issue #10)
    • WARNING: setDisplayToString methods have changed prototype and are incompatible with code compiled for 1.5.x (if you specified a custom font)

Version 1.5.2 released:

  • backwards compatibility with previous Arduino IDE - pre IDE version 1.0 (issue #9).

Version 1.5.1 released:

  • new character data in default font for '*' (issue #7);
  • minor optimization on inverted TM1638.

Version 1.5.0 released:

  • support for inverted module;
  • support for Arduino IDE 1.0;
  • new functions usage example added;
  • some restructuring.

Version 1.4.0 released:

  • support for specifying dots on setDisplayToString (issue #6)
    • WARNING: setDisplayToString methods have changed prototype and are incompatible with code compiled for 1.3.x (if you specified a custom font)

Version 1.3.2 released:

  • correction of string library import (issue #5).

Version 1.3.1 released:

  • changed pins on the examples to match schematics on project site.

Version 1.3.0 released:

  • added support for String Object;
  • added support for removing leading zeros in displaying numbers.

Version 1.2.0 released: added support for writing text.

Version 1.1.0: restructuring and added 2 proper examples, available in the arduino ide.

Example schematics

Example schematic for one module

Example schematic

tm1638helper.png tm1638%20-%20one%20module_schem.png tm1638_schem.png