Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove clean and set brightness from begin #42

Merged
merged 3 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Release Notes for TM1637TinyDisplay

## v1.12.0 - Clear Display Option

* 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 https://github.com/jasonacox/TM1637TinyDisplay/pull/42.

```cpp
//! 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);
}
}
```

## v1.11.0 - Enhanced Character Set

* Updated character set by @J-Brinkman in https://github.com/jasonacox/TM1637TinyDisplay/issues/39
Expand Down
9 changes: 6 additions & 3 deletions TM1637TinyDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,19 @@ TM1637TinyDisplay::TM1637TinyDisplay(uint8_t pinClk, uint8_t pinDIO, unsigned in
m_flipDisplay = flip;
}

void TM1637TinyDisplay::begin()
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);
clear();
setBrightness(BRIGHT_HIGH);
if (clearDisplay)
{
clear();
setBrightness(BRIGHT_HIGH);
}
}

void TM1637TinyDisplay::flipDisplay(bool flip)
Expand Down
3 changes: 2 additions & 1 deletion TM1637TinyDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ class TM1637TinyDisplay {
//!
//! 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);

//! Sets the orientation of the display.
//!
Expand Down
9 changes: 6 additions & 3 deletions TM1637TinyDisplay6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,19 @@ TM1637TinyDisplay6::TM1637TinyDisplay6(uint8_t pinClk, uint8_t pinDIO,
m_flipDisplay = flip;
}

void TM1637TinyDisplay6::begin()
void TM1637TinyDisplay6::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);
clear();
setBrightness(BRIGHT_HIGH);
if (clearDisplay)
{
clear();
setBrightness(BRIGHT_HIGH);
}
}

void TM1637TinyDisplay6::flipDisplay(bool flip)
Expand Down
3 changes: 2 additions & 1 deletion TM1637TinyDisplay6.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ class TM1637TinyDisplay6 {
//!
//! 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);

//! Sets the orientation of the display.
//!
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=TM1637TinyDisplay
version=1.11.0
version=1.12.0
author=Jason Cox <[email protected]>
maintainer=Jason Cox <[email protected]>
sentence=A simple library to display numbers, text and animation on 4 and 6 digit 7-segment TM1637 based display modules. Offers non-blocking animations and scrolling!
Expand Down
Loading