Skip to content

v1.12.0 - Clear Display Option

Latest
Compare
Choose a tag to compare
@jasonacox jasonacox released this 02 Nov 03:36
848382a

What's Changed

  • Update begin() function to allow parameter control of display clear and full brightness setting. Default behavior if not specified will be true which is the behavior with prior version.
  • Remove clean and set brightness from begin by @smaryus in #42.
//! Initialize the display, setting the clock and data pins.
//!
//! This method should be called once (typically in setup()) before calling any other.
//! @note It may be unnecessary depending on your hardware configuration.
void begin();
//! @param clearDisplay - Clear display and set the brightness to maximum value.
void begin(bool clearDisplay=true);

void TM1637TinyDisplay::begin(bool clearDisplay)
{
  // Set the pin direction and default value.
  // Both pins are set as inputs, allowing the pull-up resistors to pull them up
  pinMode(m_pinClk, INPUT);
  pinMode(m_pinDIO, INPUT);
  digitalWrite(m_pinClk, LOW);
  digitalWrite(m_pinDIO, LOW);
  if (clearDisplay)
  {
    clear();
    setBrightness(BRIGHT_HIGH);
  }
}

New Contributors

Full Changelog: v1.11.0...v1.12.0