Problem with display colon on TM1637

I've been doing the time counter with TM1637 with this library <TM1637.h> . The time counter works fine but it won't display the colon on module. I tried almost everything that I got but still can't get to it. So I might need your help.

Here is my code.

#include <TM1637.h>
#include <TM1637Display.h>
#define CLK 2
#define DIO 3
float millisec = 0;
float sec = 0;

TM1637Display display(CLK,DIO);
TM1637 tm(CLK,DIO);

void setup() {  
  display.setBrightness(0.5); // กำหนดความสว่างของ display ตั้งแต่ 1-7
  Serial.begin(9600);
}

void loop() {

  sec = millis();
  millisec = millis();  // millis() is the function that returns the number of milliseconds passed since the Arduino board began running the current program. 

  display.showNumberDec(millisec, false ,3,2);  // showNumberDecEx(number,dots,leading_zeros,length,position)
  display.showNumberDec(sec/1000, false,2,0);   // sec คือเอาค่า millisec หาร 1000 จะได้ค่าเป็นวินาที วางไว้ที่สองหน่วยแรก
}

display.setBrightness(0.5);
setBrightness takes int. 0.5 is 0

showNumberDec should show a comma, not a colon

please post a picture of the display and link to the datasheet of the display. I'm pretty good in reading datasheets but you can't expect that I know all devices and all their specs.
You want help so you should make it easy to help you through providing pictures and a datasheet.

If you have questions about this just post them to make clear what your questions are. You can't expect that the users here write a full blown tutorial about anything just in case it might be a question of you.

google is ALWAYS worth a five-minute search
in 80% of all cases you will find useful information.

search with keyword "arduino" and relevant additional words
Sometimes I start with 8 words and get relevant hits. If not I reduce the number of words.

best regards Stefan

1 Like