Sorry that it may be trivial to some, but I'm just starting out so it is interesting to me none the less...lol.
This is the code that I'm currently using to get some activity:
/ One digit 7 segment LED display demo.
// Displays digit 0 - 9 and decimal point
int segPins[] = {6, 5, 2, 3, 4, 7, 8, 9, 10, 11, 12}; // { a b c d e f g . red blue green)
//red =10; // lights red on RGB
//green = 12; //lights green on RGB
//blue =11; // lights blue on RGB
byte segCode[14][11] = {
// a b c d e f g . red blue green
{ 1, 1, 1, 1, 1, 1, 0, 0, 1, 1}, // 0 + lights magenta
{ 0, 1, 1, 0, 0, 0, 0, 0}, // 1
{ 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0}, // 2 + lights blue only
{ 1, 1, 1, 1, 0, 0, 1, 0}, // 3
{ 0, 1, 1, 0, 0, 1, 1, 0}, // 4
{ 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0}, // 5 + lights red only
{ 1, 0, 1, 1, 1, 1, 1, 0}, // 6
{ 1, 1, 1, 0, 0, 0, 0, 0}, // 7
{ 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1}, // 8 + lights green only
{ 1, 1, 1, 1, 0, 1, 1, 0}, // 9
{ 0, 0, 0, 0, 0, 0, 0, 1}, // .
};
void displayDigit(int digit)
{
for (int i=0; i < 11; i++)
{
digitalWrite(segPins
, segCode[digit]);
}
}
//***************************************************************************
//******************************************************************************
void setup()
{
for (int i=0; i < 11; i++)
{
pinMode(segPins, OUTPUT);
}
}
//******************************************************************************
//******************************************************************************
void loop()
{
for (int n = 0; n < 14; n++) // display digits 0 - 9 and decimal point
{
displayDigit(n);
delay(1000);
}
}
I've modified it for the RGB.
The biggest issue is I have no clue how to incorporate the correct code for getting the time from the RTC and then getting that to the seven segment.
Here is the only diagram I was able to create: This is using a breakout rather than the shield which I am usinghttps://www.circuito.io/app?components=512,10820,11021,375026,821989
And here is a video of everything operating.https://photos.app.goo.gl/kJmgdZtgoLGRpvFT7https://photos.app.goo.gl/kJmgdZtgoLGRpvFT7
Here is a photo, although without the RGB included:
https://photos.app.goo.gl/ezw7zSGKB9kPBvj47