diff --git a/README.md b/README.md
index be371da..db0e571 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ Arduino Library for the TM1637 Based LED Display Module
## Description
This is an Arduino library for 4 and 6 digit 7-segment LED display modules based on the TM1637 chip.
-Connect the TM1637 display CLK and DIO pins to your Arduino GPIO pins, include this library, initialize TM1637TinyDisplay and call easy to use functions like showNumber(), showString(), showLevel() and showAnimation(). Display will scroll text for larger strings. Functions support screen splitting for easy number + text formatting. Library also runs well on tiny controllers including the ATtiny85.
+Connect the TM1637 display CLK and DIO pins to your Arduino GPIO pins, include this library, initialize TM1637TinyDisplay and call easy to use functions like `showNumber()`, `showString()`, `showLevel()` and `showAnimation()`. Display will scroll text for larger strings. Functions support screen splitting for easy number + text formatting. Library also runs well on tiny controllers including the ATtiny85.
## Hardware
@@ -26,25 +26,30 @@ The display has four connectors:
* VCC - Power 5v
* GND - Ground
-Power Note: Steady clean power is important for circuit stability. If you are seeing display artifacts during high frequency updates or animation sequences, you may be experiencing power fluctuations that are impacting signal timing and communication with the TM1637. This is especially true with standalone microprocessor applications that lack any power conditioning (e.g. ATtiny85). A polarized 100uF electrolytic capacitor inserted across VCC and GND can help smooth out the spikes.
+**Power Note:** Steady clean power is important for circuit stability. If you are seeing display artifacts during high frequency updates or animation sequences, you may be experiencing power fluctuations that are impacting signal timing and communication with the TM1637. This is especially true with standalone microprocessor applications that lack any power conditioning (e.g. ATtiny85). A polarized 100uF electrolytic capacitor inserted across VCC and GND can help smooth out the spikes.
-Decimals and Colons: Some TM1637 displays come equipped with a middle colon LED (as shown above) as used in digital clocks but with no decimal points. Some displays come with decimal point LEDS for each digit. Some come with both but often the decimal point LEDs are not connected. These extra LEDs are activated by setting the upper bit (0x80) for the digit next to the dot. This library will handle setting that for you via the showNumber() function when you specify floating point numbers or via the showNumberDec() function where you can set the decimal point manually.
+**Decimals and Colons:** Some TM1637 displays come equipped with a middle colon LED (like above) as used in digital clocks but with no decimal points. Some displays come with decimal point LEDS for each digit. Some come with both but often the decimal point LEDs are not connected. These extra LEDs are activated by setting the upper eighth bit (0x80) for the digit to the left of the dot. This library will handle setting that for you via the `showNumber()` function when you specify floating point numbers, or you can do it manually via the `showNumberDec()` function where you can set the decimal points/colon yourself.
## Installation
This library is available via the Arduino IDE. Install this library via `Tools`, `Manage Libraries`, search for "TM1637TinyDisplay" and click `Install`.
-Alternatively, you can install this manually by cloning this repo into your Arduino library folder (e.g. `~/Documents/Arduino/libraries`).
+Alternatively, you can install this manually by cloning this repo into your Arduino library folder (e.g. `~/Documents/Arduino/libraries`).
## Example Code
+
+
+ Basic connection schematic done with Fritzing
+
+
```cpp
#include
#include
// Define Digital Pins
-#define CLK 1
-#define DIO 2
+#define CLK 2
+#define DIO 3
// Instantiate TM1637TinyDisplay Class
TM1637TinyDisplay display(CLK, DIO);
@@ -52,7 +57,6 @@ TM1637TinyDisplay display(CLK, DIO);
void setup() {
// Initialize Display
display.begin();
- display.setBrightness(BRIGHT_HIGH);
}
void loop() {
@@ -93,9 +97,9 @@ void loop() {
## Animation and Animator Tool
-The showAnimation() function projects a sequence of frames (patterns) onto the display. This works by defining the animation sequence through a multi-dimensional array of patterns.
+The `showAnimation()` function projects a sequence of frames (patterns) onto the display. This works by defining the animation sequence through a multi-dimensional array of patterns.
-You can use the included javascript based interactive [7-Segment LED Animator Tool](https://jasonacox.github.io/TM1637TinyDisplay/examples/7-segment-animator.html) to help build your animation. The source code is in the [Examples](examples) folder. This tool will let you set up the LED sequences you want, save each frame and copy the final code (a static array) directly into your sketch to use for the `showAnimation(data, frames, timing)` function. Here is an example:
+You can use the included javascript based interactive [7-Segment LED Animator Tool](https://jasonacox.github.io/TM1637TinyDisplay/examples/7-segment-animator.html) to help build your animation. The source code is in the [Examples](examples) folder. This tool will let you set up the LED sequences you want, save each frame and copy the final code (a static array) directly into your sketch to use for the `showAnimation(data, frames, timing)` function. Here is an example:
```cpp
// Data from Animator Tool
@@ -126,7 +130,7 @@ const uint8_t ANIMATION[12][4] = {

-This library now supports the 6-digit display as well as the 4-digit display. The 6-digit display requires additional handling. Specifically, the display digits are not sequential (requires a map) and the 7-segment LED data must be uploaded in reverse order.
+This library now supports the 6-digit display as well as the 4-digit display. The 6-digit display requires additional handling. Specifically, the display digits are not sequential (requires a map) and the 7-segment LED data must be uploaded in reverse order.
TM1637TinyDisplay6 handles this for you but you must initialize the display using the TM1637TinyDisplay6 class:
@@ -136,16 +140,14 @@ TM1637TinyDisplay6 handles this for you but you must initialize the display usin
#include // Include 6-Digit Display Class Header
// Define Digital Pins
-#define CLK 1
-#define DIO 2
+#define CLK 2
+#define DIO 3
TM1637TinyDisplay6 display(CLK, DIO); // 6-Digit Display Class
void setup()
{
display.begin();
- display.setBrightness(BRIGHT_HIGH);
- display.clear();
display.showString("digits");
delay(1000);
display.showNumber(123456);
@@ -177,7 +179,7 @@ The library provides a single class named TM1637TinyDisplay with the following f
* `isflipDisplay()` - Returns orientation of the display (True = flip)
* `readBuffer(..)` - Returns current display segment values
-PROGMEM functions: Large string or animation data can be left in Flash instead of being loaded in to SRAM to save memory.
+PROGMEM functions: Large string or animation data can be left in Flash instead of being loaded in to SRAM to save memory.
* `showAnimation_P(..)` - Display a sequence of frames to render an animation (in PROGMEM)
* `showString_P(..)` - Display a ASCII string of text with optional scrolling for long strings (in PROGMEM)
@@ -197,4 +199,4 @@ Refer to [TM1637TinyDisplay.h](TM1637TinyDisplay.h) for information on available
* SevenSegmentTM1637 Arduino Library by Bram Harmsen - https://github.com/bremme/arduino-tm1637
* Arduino - https://playground.arduino.cc/Main/TM1637/
* MCI Electronics Datasheet for TM1637 - https://www.mcielectronics.cl/website_MCI/static/documents/Datasheet_TM1637.pdf
-* TM16xx - Library for entire TM16xx chip family include maxint-rd's own [display-modules](https://github.com/maxint-rd/arduino-modules#display-modules) - https://github.com/maxint-rd/TM16xx
\ No newline at end of file
+* TM16xx - Library for entire TM16xx chip family include maxint-rd's own [display-modules](https://github.com/maxint-rd/arduino-modules#display-modules) - https://github.com/maxint-rd/TM16xx
diff --git a/RELEASE.md b/RELEASE.md
index 07b4ae3..2741b47 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -1,5 +1,9 @@
# Release Notes for TM1637TinyDisplay
+## v1.8.1 - Updated begin() method to set default brightness
+
+* Updated the `begin()` method to set a non zero default brightness for the display, as reported in https://github.com/jasonacox/TM1637TinyDisplay/pull/29#issuecomment-1446362105
+
## v1.8.0 - Updated library operation with new begin() method
* Updated library operation to include an initializing method `begin()` to move outside the constructor hardware related calls, as reported in https://github.com/jasonacox/TM1637TinyDisplay/issues/28
diff --git a/TM1637TinyDisplay.cpp b/TM1637TinyDisplay.cpp
index a1cd839..3db4aa2 100644
--- a/TM1637TinyDisplay.cpp
+++ b/TM1637TinyDisplay.cpp
@@ -183,6 +183,7 @@ void TM1637TinyDisplay::begin()
digitalWrite(m_pinClk, LOW);
digitalWrite(m_pinDIO, LOW);
clear();
+ setBrightness(BRIGHT_HIGH);
}
void TM1637TinyDisplay::flipDisplay(bool flip)
diff --git a/TM1637TinyDisplay6.cpp b/TM1637TinyDisplay6.cpp
index ce0ec50..ad1a126 100644
--- a/TM1637TinyDisplay6.cpp
+++ b/TM1637TinyDisplay6.cpp
@@ -185,6 +185,7 @@ void TM1637TinyDisplay6::begin()
digitalWrite(m_pinClk, LOW);
digitalWrite(m_pinDIO, LOW);
clear();
+ setBrightness(BRIGHT_HIGH);
}
void TM1637TinyDisplay6::flipDisplay(bool flip)
diff --git a/examples/4-digit-display-basic.fzz b/examples/4-digit-display-basic.fzz
new file mode 100644
index 0000000..6eaf83d
Binary files /dev/null and b/examples/4-digit-display-basic.fzz differ
diff --git a/examples/4-digit-display-basic_bb.png b/examples/4-digit-display-basic_bb.png
new file mode 100644
index 0000000..97a5f0e
Binary files /dev/null and b/examples/4-digit-display-basic_bb.png differ
diff --git a/examples/4-digit-display-basic_bb.svg b/examples/4-digit-display-basic_bb.svg
new file mode 100644
index 0000000..52374ba
--- /dev/null
+++ b/examples/4-digit-display-basic_bb.svg
@@ -0,0 +1,4138 @@
+
+
+
diff --git a/examples/ATtiny85/ATtiny85.ino b/examples/ATtiny85/ATtiny85.ino
index a76d7be..f4aebdc 100644
--- a/examples/ATtiny85/ATtiny85.ino
+++ b/examples/ATtiny85/ATtiny85.ino
@@ -330,7 +330,6 @@ const PROGMEM char FlashString2[] = "good";
void setup() {
display.begin();
- display.setBrightness(BRIGHT_7);
}
void loop() {
diff --git a/examples/TM1637-6Digit-Test/TM1637-6Digit-Test.ino b/examples/TM1637-6Digit-Test/TM1637-6Digit-Test.ino
index be1a835..0216972 100644
--- a/examples/TM1637-6Digit-Test/TM1637-6Digit-Test.ino
+++ b/examples/TM1637-6Digit-Test/TM1637-6Digit-Test.ino
@@ -157,7 +157,6 @@ TM1637TinyDisplay6 display(CLK, DIO);
void setup()
{
display.begin();
- display.setBrightness(BRIGHT_HIGH);
}
void loop()
diff --git a/examples/TM1637-Countdown-Buttons/TM1637-Countdown-Buttons.ino b/examples/TM1637-Countdown-Buttons/TM1637-Countdown-Buttons.ino
index 7c50d72..fbf9cf9 100644
--- a/examples/TM1637-Countdown-Buttons/TM1637-Countdown-Buttons.ino
+++ b/examples/TM1637-Countdown-Buttons/TM1637-Countdown-Buttons.ino
@@ -56,7 +56,6 @@ int Sec = 0;
void setup()
{
display.begin();
- display.setBrightness(BRIGHT_HIGH);
pinMode(BUTTON_UP, INPUT_PULLUP);
pinMode(BUTTON_DOWN, INPUT_PULLUP);
diff --git a/examples/TM1637-Countdown/TM1637-Countdown.ino b/examples/TM1637-Countdown/TM1637-Countdown.ino
index d6e9163..8b48009 100644
--- a/examples/TM1637-Countdown/TM1637-Countdown.ino
+++ b/examples/TM1637-Countdown/TM1637-Countdown.ino
@@ -48,7 +48,6 @@ unsigned long countDown;
void setup()
{
display.begin();
- display.setBrightness(BRIGHT_HIGH);
// Record Epoch - Same as Timer Reset
startTime = millis();
diff --git a/examples/TM1637-NonBlockingAnimate/TM1637-NonBlockingAnimate.ino b/examples/TM1637-NonBlockingAnimate/TM1637-NonBlockingAnimate.ino
index 92a13c5..7b23c38 100644
--- a/examples/TM1637-NonBlockingAnimate/TM1637-NonBlockingAnimate.ino
+++ b/examples/TM1637-NonBlockingAnimate/TM1637-NonBlockingAnimate.ino
@@ -121,7 +121,6 @@ void setup()
{
Serial.begin(9600);
display.begin();
- display.setBrightness(BRIGHT_HIGH);
AnimationNum = 0;
}
diff --git a/examples/TM1637Demo/TM1637Demo.ino b/examples/TM1637Demo/TM1637Demo.ino
index bc95319..d22b947 100644
--- a/examples/TM1637Demo/TM1637Demo.ino
+++ b/examples/TM1637Demo/TM1637Demo.ino
@@ -322,7 +322,6 @@ const uint8_t ANIMATION3[218][4] PROGMEM = {
void setup() {
display.begin();
- display.setBrightness(BRIGHT_7);
display.showNumber(1234);
delay(1000);
diff --git a/library.properties b/library.properties
index 545e505..b167af0 100644
--- a/library.properties
+++ b/library.properties
@@ -1,5 +1,5 @@
name=TM1637TinyDisplay
-version=1.8.0
+version=1.8.1
author=Jason Cox
maintainer=Jason Cox
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!