Back to bytes
This commit is contained in:
parent
0d85edbb42
commit
15dc4ee679
|
@ -33,11 +33,11 @@ void SegmentDisplay::end()
|
||||||
|
|
||||||
void SegmentDisplay::writeNumber(int value)
|
void SegmentDisplay::writeNumber(int value)
|
||||||
{
|
{
|
||||||
unsigned char digitMask = 1;
|
byte digitMask = 1;
|
||||||
|
|
||||||
for (unsigned char digit = digits; digit > 0; digit--)
|
for (byte digit = digits; digit > 0; digit--)
|
||||||
{
|
{
|
||||||
writeDigit((unsigned char)(value % 10), digitMask);
|
writeDigit((byte)(value % 10), digitMask);
|
||||||
|
|
||||||
value /= 10;
|
value /= 10;
|
||||||
digitMask <<= 1;
|
digitMask <<= 1;
|
||||||
|
@ -55,9 +55,9 @@ void SegmentDisplay::writeNumber(int value)
|
||||||
|
|
||||||
void SegmentDisplay::writeText(char* value)
|
void SegmentDisplay::writeText(char* value)
|
||||||
{
|
{
|
||||||
unsigned char digitMask = 1;
|
byte digitMask = 1;
|
||||||
unsigned char digit = digits;
|
byte digit = digits;
|
||||||
unsigned char charValue;
|
byte charValue;
|
||||||
|
|
||||||
while (digit > 0 && value != '\0')
|
while (digit > 0 && value != '\0')
|
||||||
{
|
{
|
||||||
|
@ -94,7 +94,7 @@ void SegmentDisplay::writeText(char* value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void SegmentDisplay::writeDigit(unsigned char value, unsigned char digitMask)
|
inline void SegmentDisplay::writeDigit(byte value, byte digitMask)
|
||||||
{
|
{
|
||||||
writeDisplay(SDNumberSegments[value], digitMask);
|
writeDisplay(SDNumberSegments[value], digitMask);
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ inline void SegmentDisplay::writeDigit(unsigned char value, unsigned char digitM
|
||||||
|
|
||||||
#if defined(SDSupportSPI)
|
#if defined(SDSupportSPI)
|
||||||
|
|
||||||
inline void SegmentDisplay::writeDisplay(unsigned char characterMask, unsigned char digitMask)
|
inline void SegmentDisplay::writeDisplay(byte characterMask, byte digitMask)
|
||||||
{
|
{
|
||||||
SPI.beginTransaction(SPISettings(clockSpeed, MSBFIRST, SPI_MODE0));
|
SPI.beginTransaction(SPISettings(clockSpeed, MSBFIRST, SPI_MODE0));
|
||||||
SPI.transfer(characterMask);
|
SPI.transfer(characterMask);
|
||||||
|
@ -112,7 +112,7 @@ inline void SegmentDisplay::writeDisplay(unsigned char characterMask, unsigned c
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
inline void SegmentDisplay::writeDisplay(unsigned char characterMask, unsigned char digitMask)
|
inline void SegmentDisplay::writeDisplay(byte characterMask, byte digitMask)
|
||||||
{
|
{
|
||||||
digitalWrite(latchPin, LOW);
|
digitalWrite(latchPin, LOW);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue