Go Down

Topic: Display Decimal Point on 4 Digit LED with TM1637 (Read 12869 times) previous topic - next topic

KenB001

Hi I recently purchased a 4 digit LED display (see attached) but cant work out how to light up the decimal points I have tried  "TM1637Display" ,"SevenSegmentTM1637" and "TM1637" library's
they seem to support the LED displays with a colon between 2 sets of digits.
can anyone point me in the right direction.

PaulS

Quote
see attached
I've got a card with the answer on it.

Here's a picture of the back of the card.












Hope that helps.

Really, wouldn't a link to the data sheet for your device have been more useful than a picture of it?
The art of getting good answers lies in asking good questions.

Arctic_Eddie

Here's an example from an Adafruit 7 segment display. The third argument in the call is the boolean for the decimal point status. Look in your display library and see if the function wants three arguments.
Code: [Select]

    voltsDisplay.writeDigitNum( 1, dig1K, true );   // Ones of volts

6v6gt

Here is a guide for a TM1637 Display Module.
(also attached)
You find instructions for activating the center colon.


 

KenB001

sorry I don't have a data sheet for this module.
I think the Adafruit display use a different driver "MAX7219CNG LED MATRIX/DIGIT DISPLAY DRIVER"
And the PDF you refer to only shows the display with  a colon and not decimal points.
I think that covers all your replies Thanks.

PaulS

Quote
sorry I don't have a data sheet for this module.
Why would you buy something with no documentation?
The art of getting good answers lies in asking good questions.

6v6gt


KenB001

thanks I will try the examples in the library and see how I go.

yurij

Anyone had luck with getting that decimal place to work? I am using this flavor of hardware
https://www.ebay.com/itm/0-56-inch-TM1637-4-Bits-LED-Clock-Tube-Display-for-Arduino-Red-Blue-Green-White/112674024638?hash=item1a3be52cbe:m:mU29WDo2Sfcy3aGBDVrYUNA
I used avishorp's TM1637 driver.  I set every bit on and still the DP does not light. Only the colon is accessible. thx
-yurij

GaryiLyons

OK. This had me beat for some time. 
It's all up to how the Displays are configured by the module manufacturer.
The displays have 12 pins.
The 12 pins are used to drive the display module in a 'matrix' form as 4 x 8.
4 digits by 8 LEDs in each.
7 LEDs are mapped obviously to the 7 segment numeric character.
That leaves 4 x 1 LED drivers left.

BUT.  If you have a DP on each digit that's four, plus the two centre 'colan' LEDs typically used for a clock.

6 into 4 obviously doesn't go!

So, manufacturers of the modules either put them out for Clock display usage (drive the colan LEDs) OR for 'numeric' use where the 4 DP's are driven.
Refer attached.

If you are like me and just bought it cheaply off the internet with no specs, then you also likely got the clock type.


PS: The library for the TM1637 doesn't drive the DPs anyway. You can change this in the setSegments function by setting the top bit in each display byte written out - segments[k]

TomGeorge

Hi,
Did you look at the test example from the  TM1637Display library from here;

https://playground.arduino.cc/Main/TM1637

Code: [Select]

#include <Arduino.h>
#include <TM1637Display.h>

// Module connection pins (Digital Pins)
#define CLK 2
#define DIO 3

// The amount of time (in milliseconds) between tests
#define TEST_DELAY   2000

const uint8_t SEG_DONE[] = {
SEG_B | SEG_C | SEG_D | SEG_E | SEG_G,           // d
SEG_A | SEG_B | SEG_C | SEG_D | SEG_E | SEG_F,   // O
SEG_C | SEG_E | SEG_G,                           // n
SEG_A | SEG_D | SEG_E | SEG_F | SEG_G            // E
};

TM1637Display display(CLK, DIO);

void setup()
{
}

void loop()
{
  int k;
  uint8_t data[] = { 0xff, 0xff, 0xff, 0xff };
  display.setBrightness(0x0f);

  // All segments on
  display.setSegments(data);
  delay(TEST_DELAY);

  // Selectively set different digits
  data[0] = 0b01001001;
  data[1] = display.encodeDigit(1);
  data[2] = display.encodeDigit(2);
  data[3] = display.encodeDigit(3);

  for(k = 3; k >= 0; k--) {
display.setSegments(data, 1, k);
delay(TEST_DELAY);
}

  display.setSegments(data+2, 2, 2);
  delay(TEST_DELAY);

  display.setSegments(data+2, 2, 1);
  delay(TEST_DELAY);

  display.setSegments(data+1, 3, 1);
  delay(TEST_DELAY);


  // Show decimal numbers with/without leading zeros
  bool lz = false;
  for (uint8_t z = 0; z < 2; z++) {
for(k = 0; k < 10000; k += k*4 + 7) {
display.showNumberDec(k, lz);
delay(TEST_DELAY);
}
lz = true;
  }

  // Show decimal number whose length is smaller than 4
  for(k = 0; k < 4; k++)
data[k] = 0;
  display.setSegments(data);

// Run through all the dots
for(k=0; k <= 4; k++) {
display.showNumberDecEx(0, (0x80 >> k), true);
delay(TEST_DELAY);
}

  display.showNumberDec(153, false, 3, 1);
  delay(TEST_DELAY);
  display.showNumberDec(22, false, 2, 2);
  delay(TEST_DELAY);
  display.showNumberDec(0, true, 1, 3);
  delay(TEST_DELAY);
  display.showNumberDec(0, true, 1, 2);
  delay(TEST_DELAY);
  display.showNumberDec(0, true, 1, 1);
  delay(TEST_DELAY);
  display.showNumberDec(0, true, 1, 0);
  delay(TEST_DELAY);

  // Brightness Test
  for(k = 0; k < 4; k++)
data[k] = 0xff;
  for(k = 0; k < 7; k++) {
    display.setBrightness(k);
    display.setSegments(data);
    delay(TEST_DELAY);
  }
  
  // On/Off test
  for(k = 0; k < 4; k++) {
    display.setBrightness(7, false);  // Turn off
    display.setSegments(data);
    delay(TEST_DELAY);
    display.setBrightness(7, true); // Turn on
    display.setSegments(data);
    delay(TEST_DELAY);  
  }

  // Done!
  display.setSegments(SEG_DONE);

  while(1);
}


This section may show you what you need to activate the decimal points
 
Code: [Select]
// Run through all the dots
for(k=0; k <= 4; k++) {
display.showNumberDecEx(0, (0x80 >> k), true);
delay(TEST_DELAY);
}



Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

GaryiLyons

You are right about the TM1637 Library.
I had been using the showNumberDec call which forces all Dots OFF.

showNumberDecEx uses second variable to control Dots.

IF FITTED.

My point to clear up for other unwary buyers is that most 4 digit LED modules employing the TM1637 are manufactured with the centre colan 'clock' dots pinned out, not the points assosciated with each digit.

Refer details and attached circuits in previous post.

xRootbeer21

To light the colon symbol on a digital tube using a TM1637 chip and the TM1637Display.h library:

display.showNumberDecEx(number, 64, true);

The second parameter in the argument must be 64 or larger to illuminate the colon!
Also, the first and third parameter are correlated:
The first parameter is what is displayed. The third parameter when true sets all digits to zero (until changed by first parameter). When the third parameter is false, only the value of first parameter is displayed - no zeros for all digits.

heatvent

Is it possible on a module in "clock" mode to solder a wire to one of the 12 pins to the display itself and separately control the decimal points via an additional digital connection to the arduino, bypassing the TM1637 chip and directly controlling the attached LED display?

Go Up