/*
Basic scrolling text example for two combined TM1637 4-digit displays.
Kept small to show simple display functionality.
For more information see https://github.com/maxint-rd/TM16xx
*/
#include <TM1637.h>
#include <TM16xxDisplay.h>
TM1637 module1(3, 2); // DIO=3, CLK=2 (using default of 4 digits)
TM1637 module2(3, 4); // DIO=3, CLK=4 (DIO can be combined when using separate clock lines)
TM16xx *arr[]={&module2, &module1}; // array of two TM1637 modules
TM16xxDisplay display(arr, 2, 8); // One display of two TM16xx modules, 8 digits in total
void setup() {
display.println("testing");
delay(1000);
display.clear();
}
int nCount=0;
// Note: a 7-segment display needs compromizes when showing alpha-numeric characters.
// Some characters will show the same (eg. 9 and g, H and x) and others require new shapes (e.g k, m and w).
String sText=String("1234567890 - The quick brown fox jumps over the lazy dog... ");
void loop() {
delay(200);
if(nCount>sText.length()) nCount=0;
nCount++;
display.setCursor(8-nCount); // start position of println can be negative
display.println(sText);
}