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