@@ -340,8 +340,6 @@ bool HT16K33::setBrightnessSingle(uint8_t displayNumber, uint8_t duty)
340
340
{
341
341
if (duty > 15 ) // Error check
342
342
duty = 15 ;
343
- else if (duty < 0 )
344
- duty = 0 ;
345
343
346
344
uint8_t dataToWrite = ALPHA_CMD_DIMMING_SETUP | duty;
347
345
return (writeRAM (lookUpDisplayAddress (displayNumber), dataToWrite));
@@ -744,7 +742,7 @@ uint16_t HT16K33::getSegmentsToTurnOn(uint8_t charPos)
744
742
size_t HT16K33::write (uint8_t b)
745
743
{
746
744
// If user wants to print '.' or ':', don't increment the digitPosition!
747
- if (b == ' .' | b == ' :' )
745
+ if (b == ' .' || b == ' :' )
748
746
printChar (b, 0 );
749
747
else
750
748
{
@@ -869,13 +867,13 @@ bool HT16K33::shiftLeft(uint8_t shiftAmt)
869
867
870
868
bool HT16K33::readRAM (uint8_t address, uint8_t reg, uint8_t *buff, uint8_t buffSize)
871
869
{
872
- uint8_t displayNum = 0 ;
870
+ uint8_t displayNum = 1 ;
873
871
if (address == _deviceAddressDisplayTwo)
874
- displayNum = 1 ;
875
- else if (address == _deviceAddressDisplayThree)
876
872
displayNum = 2 ;
877
- else if (address == _deviceAddressDisplayFour )
873
+ else if (address == _deviceAddressDisplayThree )
878
874
displayNum = 3 ;
875
+ else if (address == _deviceAddressDisplayFour)
876
+ displayNum = 4 ;
879
877
isConnected (displayNum); // Wait until display is ready
880
878
881
879
_i2cPort->beginTransmission (address);
@@ -895,14 +893,14 @@ bool HT16K33::readRAM(uint8_t address, uint8_t reg, uint8_t *buff, uint8_t buffS
895
893
// Write the contents of the RAM array out to the Holtek IC
896
894
bool HT16K33::writeRAM (uint8_t address, uint8_t reg, uint8_t *buff, uint8_t buffSize)
897
895
{
898
- uint8_t displayNum = 0 ;
896
+ uint8_t displayNum = 1 ;
899
897
if (address == _deviceAddressDisplayTwo)
900
- displayNum = 1 ;
901
- else if (address == _deviceAddressDisplayThree)
902
898
displayNum = 2 ;
903
- else if (address == _deviceAddressDisplayFour )
899
+ else if (address == _deviceAddressDisplayThree )
904
900
displayNum = 3 ;
905
- // isConnected(displayNum); //Wait until display is ready
901
+ else if (address == _deviceAddressDisplayFour)
902
+ displayNum = 4 ;
903
+ isConnected (displayNum); // Wait until display is ready
906
904
907
905
_i2cPort->beginTransmission (address);
908
906
_i2cPort->write (reg);
0 commit comments