avishorp / TM1637

Arduino library for TM1637 (LED Driver)
GNU Lesser General Public License v3.0
427 stars 218 forks source link

Enable colon #41

Closed soweli-Luna closed 6 years ago

soweli-Luna commented 6 years ago

i'm making an extremely simple clock but i cant figure out how to light the colon. heres my code:

#include <TM1637Display.h>
#define CLK 4 //can be any digital pin
#define DIO 5 //can be any digital pin
TM1637Display display(CLK, DIO);

int hours = 6;      //set these to 
int minutes = 40;   //whatever time it is
bool am = false;    //define if its am or pm
const int led = 6;  //am/pm led indicator pin

void setup() {
}

void loop() {
  display.setBrightness(1);
  display.showNumberDec(hours * 100 + minutes, false, 4, 0);
  minutes += 1;
  if (minutes >= 60)
  {
    minutes = 0;
    hours += 1;
  }
  if (hours >= 12)
  {
    hours = 1;
    if (am == true)
    {
      am = false;
    }
    else
    {
      am = true;
    }
  }
  if (am == true)
  {
    digitalWrite(led, HIGH);
  }
  else
  {
    digitalWrite(led, LOW);
  }
  delay(60000); //60 seconds
}

the following code works to enable the colon:

uint8_t segto;
int value = 1244;
segto = 0x80 | display.encodeDigit((value / 100)%10);
display.setSegments(&segto, 1, 1);

but i cant figure out how to change the number being displayed

MHz000 commented 6 years ago

same problem, got: display.showNumberDecEx(4, 0b01000000, false, 2, 0); 'class TM1637Display' has no member named 'showNumberDecEx' any idea ow to diplay the colon? Thank!

avishorp commented 6 years ago

Are you using the latest version from GitHub?

2018-06-30 11:29 GMT+03:00 MHz000 notifications@github.com:

same problem, got: display.showNumberDecEx(4, 0b01000000, false, 2, 0); 'class TM1637Display' has no member named 'showNumberDecEx' any idea ow to diplay the colon? Thank!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/avishorp/TM1637/issues/41#issuecomment-401526735, or mute the thread https://github.com/notifications/unsubscribe-auth/ABImMuhKuQ78BnF_U4mXrLBHO3j3FOuVks5uBzcBgaJpZM4UPe9b .

MHz000 commented 6 years ago

Thank you for the hint. Using the lates version solve the problem :-))

However no dots are displayed using: // display.showNumberDecEx(1234, 0x80, true, 4, 0); delay(TEST_DELAY); display.showNumberDecEx(123, 0x40, true, 4, 0); // shows ":" after the second digit delay(TEST_DELAY); display.showNumberDecEx(12, 0x20, true, 4, 0); delay(TEST_DELAY); display.showNumberDecEx(1, 0x10, true, 4, 0); delay(TEST_DELAY); //

pls give an example how to display dots after figures Thank you

2018-07-02 20:11 GMT+02:00 Avishay notifications@github.com:

Are you using the latest version from GitHub?

2018-06-30 11:29 GMT+03:00 MHz000 notifications@github.com:

same problem, got: display.showNumberDecEx(4, 0b01000000, false, 2, 0); 'class TM1637Display' has no member named 'showNumberDecEx' any idea ow to diplay the colon? Thank!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/avishorp/TM1637/issues/41#issuecomment-401526735, or mute the thread https://github.com/notifications/unsubscribe-auth/ABImMuhKuQ78BnF_ U4mXrLBHO3j3FOuVks5uBzcBgaJpZM4UPe9b .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/avishorp/TM1637/issues/41#issuecomment-401888700, or mute the thread https://github.com/notifications/unsubscribe-auth/AHmpGuEDkfRmaSOcjDo3t9DuWVVPuMhMks5uCmJTgaJpZM4UPe9b .

MHz000 commented 6 years ago

shit! It looks like my TM1637 4 digit display has "blind" dots but just the colon :-(( Any hint where a full featured display can be bought welcome

Thank-you

2018-07-02 20:11 GMT+02:00 Avishay notifications@github.com:

Are you using the latest version from GitHub?

2018-06-30 11:29 GMT+03:00 MHz000 notifications@github.com:

same problem, got: display.showNumberDecEx(4, 0b01000000, false, 2, 0); 'class TM1637Display' has no member named 'showNumberDecEx' any idea ow to diplay the colon? Thank!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/avishorp/TM1637/issues/41#issuecomment-401526735, or mute the thread https://github.com/notifications/unsubscribe-auth/ABImMuhKuQ78BnF_ U4mXrLBHO3j3FOuVks5uBzcBgaJpZM4UPe9b .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/avishorp/TM1637/issues/41#issuecomment-401888700, or mute the thread https://github.com/notifications/unsubscribe-auth/AHmpGuEDkfRmaSOcjDo3t9DuWVVPuMhMks5uCmJTgaJpZM4UPe9b .

ybaransky commented 6 years ago

I am also looking for such a device. Adafruit.com has a several 4-digit 7 segment displays that let you address the colon and the individual decimals. Unfortunately it uses a different driver chip and is much more expensive than displays that use the tm1637.

On Tue, Jul 10, 2018, 2:10 AM MHz000 notifications@github.com wrote:

shit! It looks like my TM1637 4 digit display has "blind" dots but just the colon :-(( Any hint where a full featured display can be bought welcome

Thank-you

2018-07-02 20:11 GMT+02:00 Avishay notifications@github.com:

Are you using the latest version from GitHub?

2018-06-30 11:29 GMT+03:00 MHz000 notifications@github.com:

same problem, got: display.showNumberDecEx(4, 0b01000000, false, 2, 0); 'class TM1637Display' has no member named 'showNumberDecEx' any idea ow to diplay the colon? Thank!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/avishorp/TM1637/issues/41#issuecomment-401526735, or mute the thread https://github.com/notifications/unsubscribe-auth/ABImMuhKuQ78BnF_ U4mXrLBHO3j3FOuVks5uBzcBgaJpZM4UPe9b .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/avishorp/TM1637/issues/41#issuecomment-401888700, or mute the thread < https://github.com/notifications/unsubscribe-auth/AHmpGuEDkfRmaSOcjDo3t9DuWVVPuMhMks5uCmJTgaJpZM4UPe9b

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/avishorp/TM1637/issues/41#issuecomment-403711608, or mute the thread https://github.com/notifications/unsubscribe-auth/AKgoW8E9AVSO5uFX-d8FKvbscXwfQz5tks5uFEVcgaJpZM4UPe9b .