add missing files, support display blanking
This commit is contained in:
25
CL56.cpp
25
CL56.cpp
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user