indicator blink
This commit is contained in:
@@ -230,15 +230,30 @@ void MatrixDisplayUi::tick()
|
||||
this->drawIndicators();
|
||||
this->matrix->show();
|
||||
}
|
||||
|
||||
void MatrixDisplayUi::drawIndicators()
|
||||
{
|
||||
if (indicator1State)
|
||||
if (indicator1State && !indicator1Blink)
|
||||
{
|
||||
matrix->drawPixel(31, 0, indicator1Color);
|
||||
matrix->drawPixel(30, 0, indicator1Color);
|
||||
matrix->drawPixel(31, 1, indicator1Color);
|
||||
}
|
||||
if (indicator2State)
|
||||
if (indicator2State && !indicator2Blink)
|
||||
{
|
||||
matrix->drawPixel(31, 7, indicator2Color);
|
||||
matrix->drawPixel(31, 6, indicator2Color);
|
||||
matrix->drawPixel(30, 7, indicator2Color);
|
||||
}
|
||||
|
||||
if (indicator1State && indicator1Blink && (millis() % 1000) < 500)
|
||||
{
|
||||
matrix->drawPixel(31, 0, indicator1Color);
|
||||
matrix->drawPixel(30, 0, indicator1Color);
|
||||
matrix->drawPixel(31, 1, indicator1Color);
|
||||
}
|
||||
|
||||
if (indicator2State && indicator2Blink && (millis() % 1000) < 500)
|
||||
{
|
||||
matrix->drawPixel(31, 7, indicator2Color);
|
||||
matrix->drawPixel(31, 6, indicator2Color);
|
||||
@@ -313,7 +328,7 @@ uint8_t MatrixDisplayUi::getnextAppNumber()
|
||||
|
||||
void MatrixDisplayUi::setIndicator1Color(uint16_t color)
|
||||
{
|
||||
this->indicator1Color = color;
|
||||
this->indicator1Color = color;
|
||||
}
|
||||
|
||||
void MatrixDisplayUi::setIndicator1State(bool state)
|
||||
@@ -323,10 +338,20 @@ void MatrixDisplayUi::setIndicator1State(bool state)
|
||||
|
||||
void MatrixDisplayUi::setIndicator2Color(uint16_t color)
|
||||
{
|
||||
this->indicator2Color = color;
|
||||
this->indicator2Color = color;
|
||||
}
|
||||
|
||||
void MatrixDisplayUi::setIndicator2State(bool state)
|
||||
{
|
||||
this->indicator2State = state;
|
||||
}
|
||||
|
||||
void MatrixDisplayUi::setIndicator1Blink(bool blink)
|
||||
{
|
||||
this->indicator1Blink = blink;
|
||||
}
|
||||
|
||||
void MatrixDisplayUi::setIndicator2Blink(bool blink)
|
||||
{
|
||||
this->indicator2Blink = blink;
|
||||
}
|
||||
@@ -106,6 +106,8 @@ private:
|
||||
|
||||
bool indicator1State = false;
|
||||
bool indicator2State = false;
|
||||
bool indicator1Blink = false;
|
||||
bool indicator2Blink = false;
|
||||
|
||||
uint8_t getnextAppNumber();
|
||||
void drawApp();
|
||||
@@ -158,6 +160,9 @@ public:
|
||||
void setIndicator2Color(uint16_t color);
|
||||
void setIndicator2State(bool state);
|
||||
|
||||
void setIndicator1Blink(bool Blink);
|
||||
void setIndicator2Blink(bool Blink);
|
||||
|
||||
void drawIndicators();
|
||||
// Customize indicator position and style
|
||||
|
||||
|
||||
Reference in New Issue
Block a user