add missing files, support display blanking

This commit is contained in:
2023-10-12 14:54:29 +02:00
parent 3fc72514a4
commit 9f8b9059f9
9 changed files with 293 additions and 25 deletions

View File

@ -9,9 +9,14 @@ _shiftReg(shiftReg)
void DualCl56::tick()
{
++_currentLit;
if(_currentLit > 7)_currentLit = 0;
unsigned char bits[2] = {0b10000000>>_currentLit, ~(_segments[_currentLit])};
_shiftReg->write(reinterpret_cast<unsigned char*>(&bits));
if(_currentLit > 7)
_currentLit = 0;
unsigned char bits[2] = {static_cast<unsigned char>(0b10000000 >> _currentLit),
static_cast<unsigned char>(~(_segments[_currentLit]))};
if(!_blank)
_shiftReg->write(reinterpret_cast<unsigned char*>(&bits));
}
void DualCl56::setString(const char string[], const uint8_t dp)
@ -166,5 +171,17 @@ void DualCl56::setString(const char string[], const uint8_t dp)
void DualCl56::setSegments(const uint8_t segments, const uint8_t place)
{
_segments[place] = segments;
_segments[place] = segments;
}
void DualCl56::setBlank(bool blankIn)
{
_blank = blankIn;
if(_blank)
_shiftReg->clear();
}
bool DualCl56::getBlank()
{
return _blank;
}