Hello all,
I'm trying to create the Back to the future clock based on this project Great Scott! DeLorean-Inspired Time Circuit Clock with Adafruit gear! « Adafruit Industries – Makers, hackers, artists, designers and engineers!
I don't use i2c displays but TM1637 displays. I would like to keep the same logic to control the displays with a 74HC138N demultiplexer.
#include <Wire.h>
#include <TM1637Display.h>
#define CLK_PIN 6
#define DIO_PIN 5
#define E0 2
#define E1 3
#define E2 4
TM1637Display display[2] = {TM1637Display(CLK_PIN, DIO_PIN),TM1637Display(CLK_PIN, DIO_PIN)};
void setup()
{
Serial.begin(9600);
pinMode(E0, OUTPUT);
pinMode(E1, OUTPUT);
pinMode(E2, OUTPUT);
digitalWrite(E0, LOW);
digitalWrite(E1, LOW);
digitalWrite(E2, LOW);
display[0].setBrightness(0);
display[0].clear();
digitalWrite(E0, HIGH);
digitalWrite(E1, LOW);
digitalWrite(E2, LOW);
display[1].setBrightness(0);
display[1].clear();
}
void loop() {
digitalWrite(E0, LOW);
digitalWrite(E1, LOW);
digitalWrite(E2, LOW);
display[0].showNumberDecEx(123,0, true);
digitalWrite(E0, HIGH);
digitalWrite(E1, LOW);
digitalWrite(E2, LOW);
display[1].showNumberDecEx(456,0, true);
delay(1000);
}
I plugged the DIO input on the same line and the CLK on each outputs of the demultiplexer. Unfortunately it doesn't work. I read that it could be possible to use the same CLK signal and DIO signal different. So I plugged the the DIO on the outputs of the demultiplexer, but still not working.
So I'm a bit lost, I've tried to plug i2c displays instead of the TM1637 to confirm the electronic assembly and components and it works.
If someone has an idea, explanation, I'm all ears.
Thanks you and sorry for my English but I'm French.




