You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
451 B

#include <ViewStates.h>
void ViewState::setColor(uint8_t _color)
{
color = _color;
};
void ViewState::renderBinaryClock(uint8_t matrix[121], DS3231 &ds3231)
{
uint8_t h = ds3231.getHours() % 12;
uint8_t mm = ds3231.getMinutes();
for (int b = 0; b < 4; b++)
{
if (bitRead(h, b))
{
matrix[110 + b] = color;
}
}
for (int b = 0; b < 6; b++)
{
if (bitRead(mm, b))
{
matrix[115 + b] = color;
}
}
};