Hi,
I'm trying to get the minutes from an RTC using RTCLib to use with a 7 segment display. Everything else is already working, I just need the minutes I've got the 10 spot working using a long handed version, but need the ones spot.
// Minutes
if(now.minute()>=10)
{
matrix.writeDigitNum(3, 1);
}
if(now.minute()>=20)
{
matrix.writeDigitNum(3, 2);
}
if(now.minute()>=30)
{
matrix.writeDigitNum(3, 3);
}
if(now.minute()>=40)
{
matrix.writeDigitNum(3, 4);
}
if(now.minute()>=50)
{
matrix.writeDigitNum(3, 5);
}
if(now.minute()<=9)
{
matrix.writeDigitNum(3, 0);
}
For the ones spot, this method would be far too long.
What I've got for the ones spot so far is:
for(int x;x<=59;x++)
{
if(now.minute() ==x)
{
matrix.writeDigitNum(4, x);
}
}
Obviously this only works in some cases. Is there an easy way to parse out the one spot minutes. For example, how do I get the 2 out of 11:52?
Thanks