Back to bytes
This commit is contained in:
parent
0d85edbb42
commit
15dc4ee679
@ -33,11 +33,11 @@ void SegmentDisplay::end()
|
||||
|
||||
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;
|
||||
digitMask <<= 1;
|
||||
@ -55,9 +55,9 @@ void SegmentDisplay::writeNumber(int value)
|
||||
|
||||
void SegmentDisplay::writeText(char* value)
|
||||
{
|
||||
unsigned char digitMask = 1;
|
||||
unsigned char digit = digits;
|
||||
unsigned char charValue;
|
||||
byte digitMask = 1;
|
||||
byte digit = digits;
|
||||
byte charValue;
|
||||
|
||||
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);
|
||||
}
|
||||
@ -102,7 +102,7 @@ inline void SegmentDisplay::writeDigit(unsigned char value, unsigned char digitM
|
||||
|
||||
#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.transfer(characterMask);
|
||||
@ -112,7 +112,7 @@ inline void SegmentDisplay::writeDisplay(unsigned char characterMask, unsigned c
|
||||
|
||||
#else
|
||||
|
||||
inline void SegmentDisplay::writeDisplay(unsigned char characterMask, unsigned char digitMask)
|
||||
inline void SegmentDisplay::writeDisplay(byte characterMask, byte digitMask)
|
||||
{
|
||||
digitalWrite(latchPin, LOW);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user