/*
Simple example of using animation frames to display a message ala calculator-speak.
/*
// Includes
#include <Arduino.h>
#include <TM1637TinyDisplay.h>
// Module connection pins (Digital Pins)
#define CLK 2
#define DIO 3
// The amount of time (in milliseconds) between tests
#define TEST_DELAY 1000
// Example animation sequence for showAnimation() Test
// Built with 7-Segment Animator Tool
// https://jasonacox.github.io/TM1637TinyDisplay/examples/7-segment-animator.html
/* Animation Data - HGFEDCBA Map */
const uint8_t ANIMATION[5][4] = {
{ 0x76, 0x79, 0x30, 0x30 }, // Frame 0
{ 0x3f, 0x00, 0x00, 0x00 }, // Frame 1
{ 0x76, 0x3f, 0x7e, 0x00 }, // Frame 2
{ 0x77, 0x37, 0x79, 0x00 }, // Frame 3
{ 0x66, 0x3f, 0x3e, 0x00 } // Frame 4
};
// Initialize TM1637TinyDisplay - 4 Digit Display
TM1637TinyDisplay display(CLK, DIO);
void setup()
{
Serial.begin(9600);
display.begin();
}
void loop()
{
bool isAnimationRunning = display.Animate();
if (!isAnimationRunning) {
display.clear();
delay(1000);
display.startAnimation(ANIMATION, FRAMES(ANIMATION), TIME_MS(1000));
}
}