TM1637 and Nano

Hi:

I've been using the TM1637 7-segment, 4-digit display in the Uno. Now I run the same sketch in a Nano but there is a problem: there is no persistence, I mean, after turning the segments on, they quickly turn off, so I can barely see the digits blinking.

This is the sketch, and as you can see, there is a 1-second delay between displays of numbers 1111...9999:

#include <TM1637Display.h>
// Module connection pins (Digital Pins)
#define CLK 5
#define DIO 6
TM1637Display display(CLK, DIO);
int d = 0;
void setup()
{
  display.setBrightness(7);
}
void loop() {
    while (d<=9999)
  {
    display.showNumberDec(d);
    delay(1000);
    d = d + 1111;
  }
  d = 1111;
}

It works fine in the Uno, the digits remain bright for one second until the next digit is displayed, but in the Nano they turn on only for a fraction of a second, then off until the next digit is displayed.

I thought there was a problem in the +5V pin with it not having enough power to turn the segments on, but if I remove the delay(1000) line, they are (almost) always.

Is there any compatibility issue here? Needles to say I tried different pins for CLK and DIO to no avail. And this Nano works fine in my other projects.

How are you powering the Nano? Sounds like not enough current, have you measured the supply voltage at the display?

avr_fred:
How are you powering the Nano? Sounds like not enough current, have you measured the supply voltage at the display?

I tried turning the segments on by displaying 8888 in a loop and they bright well. No problem with the power (and it's 5V at the display).

I solved the problem by altering the sketch. I count pulses in an interrupt to display rpm. There was a delay(1000) to display the reading every 1 second. Instead, I use a while() that exits after 1000 millis() and inside it I display the last reading, so the digits are always on.