Skip to content

Commit

Permalink
Version 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinlyonsrepo committed Nov 2, 2024
1 parent 8bc0e80 commit 5b78b3f
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 26 deletions.
27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
* [Model Three](#model-three)
* [Tested](#tested)
* [Notes](#notes)

* [Swapped data nibbles](#swapped-data-nibbles)
* [Read buttons anomaly](#read-buttons-anomaly)
* [Multiple displays](#multiple-displays)
* [Multiple buttons pressed together](#multiple-buttons-pressed-together)

## Overview

* Name: TM1638plus
Expand Down Expand Up @@ -153,13 +157,9 @@ SetLEDs: When you pass call the setLEDs function you can pass a word pattern whe

## Notes

1. Swapped data on Display issue on some Model 2 modules
2. Anomaly's on High frequency micro-controllers.
3. Driving multiple displays.
4. Detecting multiple buttons pressed together.

**Note 1 : Swapped display Issue: Model 2 only**

### Swapped data nibbles

Model 2 only.
For Some users using this library the nibbles in information display byte
where swapped around. This is because there are different versions of modules on market with different wiring. See issue #3 on github called Swapped display :: "12345678" becomes "56781234".
If you test library and you see this issue, in order to fix this when you declare the
Expand All @@ -170,8 +170,9 @@ Object, set the fourth parameter "swap_nibbles" to True, The default is false.
| QYF-TM1638 | default operation | false |
| QYF-TM1638 -Ver 1.0 | Swapped display Fix | true |

**Note 2 : High frequency micro-controllers.**
### Read buttons anomaly

Read buttons anomaly on High frequency micro-controllers.
This library uses a software SPI-like protocol and may not work fully on
micro-controllers running at a very high frequency, without some adjustments to timing.
It is a SPI-like interface with a single bidirectional data wire DIO.
Expand All @@ -195,12 +196,16 @@ The Teensy results have been sent in by email, I don't have these MCU's them at
| Teensy 4.0| 150Mhz | Working model 1, no Data rest of models |
| Teensy 4.0| 396Mhz | Not working on m1 pre v1.6, no data after, no Data rest of models |

**Note 3 : Driving multiple displays.**
### Multiple displays

Driving multiple displays.
It is possible to drive multiple modules. Share the DIO and CLK lines and use a unique
STB line for each device. see issue number 10 at github for example code.

**Note 4 : Detecting multiple buttons pressed together.**

### Multiple buttons pressed together

Detecting multiple buttons pressed together.

Model 1 and Model 3 CAN detect multiple buttons pressed.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

// GPIO I/O pins on the Arduino connected to strobe, clock, data,
// pick on any I/O you want.
#define STROBE_TM 4
#define CLOCK_TM 6
#define DIO_TM 7
#define STROBE_TM 4 // strobe = GPIO connected to strobe line of module
#define CLOCK_TM 6 // clock = GPIO connected to clock line of module
#define DIO_TM 7 // data = GPIO connected to data line of module


bool high_freq = false; // default false, If using a high freq CPU > ~100 MHZ set to true.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <TM1638plus_Model2.h>

// GPIO I/O pins on the Arduino connected to strobe, clock, data, pick on any I/O pin you want.
#define STROBE_TM 4 // strobe = GPIO connected to strobe line of module
#define STROBE_TM 4 // strobe = GPIO connected to strobe line of module
#define CLOCK_TM 6 // clock = GPIO connected to clock line of module
#define DIO_TM 7 // data = GPIO connected to data line of module
bool swap_nibbles = false; //Default is false if left out, see issues section in readme at URL
Expand Down
6 changes: 3 additions & 3 deletions examples/TM1638plus_TEST_Model1/TM1638plus_TEST_Model1.ino
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void Test3() {
uint8_t pos = 0;
for (pos = 0 ; pos<8 ; pos++)
{
tm.display7Seg(pos, 1<<7-pos); // Displays a single seg in (dp)gfedcba) in each pos 0-7
tm.display7Seg(pos, 1<<(7-pos)); // Displays a single seg in (dp)gfedcba) in each pos 0-7
delay(myTestDelay1);
}
}
Expand Down Expand Up @@ -137,7 +137,7 @@ void Test4() {
delay(myTestDelay3); // display 89ABCDEF
tm.reset();

tm.displayHex(1, 0xFFFE);
tm.displayHex(1, 0xFE);
tm.displayHex(7, 0x10);
delay(myTestDelay3); // display " E 0"

Expand Down Expand Up @@ -249,7 +249,7 @@ void Test12() {
{
tm.displayText(textScroll);
unsigned long currentMillis = millis();

yield(); // Added to prevent ESP8266 crash.
if (currentMillis - previousMillis_display >= interval_display)
{
previousMillis_display = currentMillis;
Expand Down
1 change: 1 addition & 0 deletions examples/TM1638plus_TEST_Model2/TM1638plus_TEST_Model2.ino
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ void Test7(void)
{
tm.DisplayStr(textScroll, 0);
unsigned long currentMillis = millis();
yield(); // Added to prevent ESP8266 crash.
// update data every interval_display delay
if (currentMillis - previousMillis_display >= interval_display)
{
Expand Down
12 changes: 6 additions & 6 deletions examples/TM1638plus_TEST_Model3/TM1638plus_TEST_Model3.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

// GPIO I/O pins on the Arduino connected to strobe, clock, data,
//pick on any I/O you want.
#define STROBE_TM 4
#define CLOCK_TM 6
#define DIO_TM 7
#define STROBE_TM 4 // strobe = GPIO connected to strobe line of module
#define CLOCK_TM 6 // clock = GPIO connected to clock line of module
#define DIO_TM 7 // data = GPIO connected to data line of module

bool high_freq = false; //default false,, If using a high freq CPU > ~100 MHZ set to true.

Expand Down Expand Up @@ -117,7 +117,7 @@ void Test3() {
uint8_t pos = 0;
for (pos = 0 ; pos<8 ; pos++)
{
tm.display7Seg(pos, 1<<7-pos); // Displays a single seg in (dp)gfedcba) in each pos 0-7
tm.display7Seg(pos, 1<<(7-pos)); // Displays a single seg in (dp)gfedcba) in each pos 0-7
delay(myTestDelay1);
}
}
Expand Down Expand Up @@ -146,7 +146,7 @@ void Test4() {

tm.reset();

tm.displayHex(1, 0xFFFE);
tm.displayHex(1, 0xFE);
tm.displayHex(7, 0x10);
delay(myTestDelay3); // display " E 0"
}
Expand Down Expand Up @@ -252,11 +252,11 @@ void Test12() {
char textScroll[17] = " Hello world 123";
unsigned long previousMillis_display = 0; // will store last time display was updated
const long interval_display = 1000; // interval at which to update display (milliseconds)

while(1)
{
tm.displayText(textScroll);
unsigned long currentMillis = millis();
yield(); // Added to prevent ESP8266 crash.
if (currentMillis - previousMillis_display >= interval_display)
{
previousMillis_display = currentMillis;
Expand Down
4 changes: 4 additions & 0 deletions extra/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@
* Added Example file TM1638plus_BUTTON_Model1.
* Added "Doxyen" style comments in order to use "Doxygen" software to automatically
generate a html based software API.

* Version 2.0.1 November 2024
* Minor update, change to examples files only. Removed some new compiler warnings
and added a 'yield()' statement to scroll tests as the watch dog timer was crashing ESP8266 during scroll loop, noticed during debugging of [github issue 24](https://github.com/gavinlyonsrepo/TM1638plus/issues/24)
4 changes: 3 additions & 1 deletion extra/GPIO_OTHER_MCUs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ ESP-32S Board 2.4GHz ESP-WROOM-32

ESP8266 ESP12-E CH340 NodeMcu V3 Lua WIF

Not Documented
#define STROBE_TM D0 // strobe = GPIO connected to strobe line of module
#define CLOCK_TM D1 // clock = GPIO connected to clock line of module
#define DIO_TM D2 // data = GPIO connected to data line of module

STM32 blue pill STM32F103C8T6 ARM STM32

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=TM1638plus
version=2.0.0
version=2.0.1
author=Gavin Lyons <[email protected]>
maintainer=Gavin Lyons <[email protected]>
sentence=TM1638plus is an Arduino library to control TM1638 seven segment modules.
Expand Down

0 comments on commit 5b78b3f

Please sign in to comment.