rjbatista / tm1638-library Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/tm1638-library
Automatically exported from code.google.com/p/tm1638-library
function setDisplayToDecNumber
-----------------------------
incorrect parameter sequence
Original issue reported on code.google.com by [email protected]
on 9 Apr 2012 at 8:20
Attachments:
Modify the librairy \arduino-1.0.4\libraries\TM1638
on line 31,32,33
#define TM1638_COLOR_NONE 0
#define TM1638_COLOR_RED 2
#define TM1638_COLOR_GREEN 1
Thanks :D
Original issue reported on code.google.com by [email protected]
on 16 May 2013 at 12:34
setDisplayToDecNumber should support negative numbers, at least in the
non-leadingZeros case (the first argument will be a signed long)
Original issue reported on code.google.com by [email protected]
on 30 Jan 2012 at 1:12
TM1640 support for setDisplayToBin/Hex/Dec/Number functions.
Original issue reported on code.google.com by [email protected]
on 17 Jan 2012 at 3:28
Could you use this syntax in your example code so we have a permanent note of
wich is the position of clk dio and stb? Thanks
#define TM1638CLK 52
#define TM1638DIO 53
#define TM1638STB0 51
TM1638 module1(TM1638DIO , TM1638CLK , TM1638STB0);
Original issue reported on code.google.com by [email protected]
on 26 Oct 2014 at 4:02
Support for displaying additional chars in the library.
Support for displaying 8 char strings.
See:
http://en.wikipedia.org/wiki/Seven-segment_display_character_representations
Original issue reported on code.google.com by [email protected]
on 19 Aug 2011 at 10:19
If you try to call
setDisplayToDecNumber(0, dots, false)
to display "0" without leading zeroes you get empty display.
Would it be possible to implement a new 'getButton' like method that has
debouncing?
It would save a step in basically every program that needs a reliable reading
of button input.
You could leave the existing getButton method for those who want to implement
their own debouncing.
Original issue reported on code.google.com by [email protected]
on 6 Jan 2012 at 5:19
I'd like to be able to set individual positions using the "FONT_DEFAULT"
letters.
Perhaps you could change the setDisplayDigit to accept "font", FONT_DEFAULT as
the fourth argument, but still have it default to "NUMBER_FONT".
Original issue reported on code.google.com by [email protected]
on 15 Dec 2011 at 10:19
Hi,
first i want to say thanks for your great library.
But your schematic for wiring the module with an arduino seemed to be wrong.
the schematic use pin 9,8,7 but it must be 2,3,4 to work correcty with your
examples in the library.
Original issue reported on code.google.com by [email protected]
on 22 Oct 2011 at 5:18
The PWM values that should cause gradual change of intensity appear to work in
the following manner:
Values of 0; 1 and 2 do change the PWM noticeably
However once the value jumps from 2 to 3 a significant change is observed .
Then values of 4;5;6 and 7 do not seem to cause any noticeable change in
intensity.
So in summary, 0;1; and 2 cause gradual change. Then a significant jump occurs
and 3;4;5;6; and 7 appear all the same.
This may very well be a display issue with the way it interprets the intensity
commands and implements the PWM internally but wanted to mention it just in
case.
Thanks
Testing code:
#include <TM1638.h>
#include <TM1640.h>
TM1640 module(3, 2);
int i=0;
void setup()
{
}
void loop()
{
char text[17];
module.setupDisplay(true,i);
sprintf(text, "HELLO %u", millis());
module.setDisplayToString(text);
delay(550);
i++;
if (i>=8)
{
i=0;
}
}
Original issue reported on code.google.com by [email protected]
on 29 Mar 2012 at 2:22
setLEDs stopped working correctly with the 2.0.0 version (because of some
changes I added to support TM1640).
Original issue reported on code.google.com by [email protected]
on 17 Jan 2012 at 3:38
It looks as if some debug code has been left in TM1638QYF.cpp on line 119:
Serial.println(values);
If I delete this line then everything then works ok.
hth David.
What steps will reproduce the problem?
1.Try to compile the TM1640 example for target ATtiny85 board (Arduino-Tiny
cores)
2.Works with IDE pre-1.0 but not with any version 1.0 or younger
3.
What is the expected output? What do you see instead?
Expect compile without errors, instead get this:
TM1638\TM16XX.cpp.o:(.rodata._ZTV6TM16XX+0x14): undefined reference to
`__cxa_pure_virtual'
What version of the product are you using? On what operating system?
Any that support TM1640 are the only ones I've tried.
Please provide any additional information below.
Discussion and remedy for the problem here:
http://arduino.cc/forum/index.php?topic=162094.new%3btopicseen#new
Original issue reported on code.google.com by [email protected]
on 22 Apr 2013 at 2:10
I've noticed the following issue on a TM1640 display.
Calling setDisplayDigit repeatedly in a loop, with the dot set to true, shows a
weird half number on the spot adjacent to it. In the sample code bellow, the
second 7-segment display will show a small inverted "r".
for (int i=0; i<=9; i++)
{
module.setDisplayDigit(i,0,true);
delay(500);
}
If the dot parameter is set to false, it works correctly. It also works
correctly when the function is called just once.
Original issue reported on code.google.com by [email protected]
on 24 Mar 2012 at 7:27
Good afternoon/morning,
After seeing a post
http://tronixstuff.wordpress.com/2012/04/09/arduino-and-tm1640-led-display-modul
es/ and decided to order two of them... just for fun really.
After trying the sample code to display a string, I wanted to display a decimal
and seeing the setDisplayToDecNumber function I implemented it and it fails to
compile.
http://pastebin.com/rE6YXsrV is my sample code and it does not want to compile
and I get the following error
sketch_jun10a.ino: In function 'void loop()':
sketch_jun10a:12: error: 'class TM1640' has no member named
'setDisplayToDecNumber'
I'm not an expert in C++ but am poking around with it a little, any ideas you
can have would be fantastic.
The only other idea is to convert all my decimal to a string before and display
it that way rather then use the right feature although that seems kinda
weird... Do you not have a 16 char LED display as the first link I provided you?
Thanks,
--Aaron
Original issue reported on code.google.com by [email protected]
on 11 Jun 2012 at 1:35
Hello,
Could you insert a function to text scroll a string ?
I mean a very simple function (for us) just to display any string.
Thank's
Original issue reported on code.google.com by [email protected]
on 18 Jun 2014 at 8:13
[deleted issue]
I can't find a way to turn one led off without messing with the status of the
others. I'm trying to find a way to make this work:
if (ch1 == 1) {
module.setLED(TM1638_COLOR_GREEN, 0); // set LED 0 to green
} else {
//something that turns ONLY led number 0 off
}
if (ch2 == 1) {
module.setLED(TM1638_COLOR_GREEN, 1); // set LED 1 to green
} else {
//something that turns ONLY led number 1 off
}
Thank you! Obrigado!
Original issue reported on code.google.com by [email protected]
on 6 Nov 2012 at 2:33
What steps will reproduce the problem?
1.Run the line "module1.setLEDs(0x0F);"
2.Rune the line "module1.setLEDs(0xF0);"
What is the expected output? What do you see instead?
1. Expect to see all LEDs as red. Only the left four light up red.
2. Expect to see all LEDs as green. Only right four light up, and as red.
Original issue reported on code.google.com by [email protected]
on 15 Dec 2011 at 10:24
I am developing an IO process which can switch on LED by Hall effect sensor and
delay 500ms to turn off after I un-press it just like 555 monostable can do. I
am using UNO R3, Arduino 1.0.5, Board is Tiny 8Mhz internal BOD off to program
a tiny85.
1. Where is a very huge delay at the 1st time around 16-20 seconds. Next click
is around 8 secs. After few time to activate the process it becomes normal
(500ms).
2. Then I leave it alone for a while (let say 30 secs), the 1st delay time is
back to 16-20 secs.
I am just thinking if the sleep function is enable by default cause this false.
If so, can anyone help to solve this problem. Thank you very much.
Chris
//////////////////////////////
const int ledSensorPin = 3;
const int led_mosfet = 2;
int ledHallState = 0;
int ledLastHallState = 0;
long previousMillis = 0;
long interval = 500;
int startCountDown = 0;
//////////////////////////////
void setup()
{
pinMode(1, INPUT);
pinMode(led_mosfet, OUTPUT);
pinMode(ledSensorPin, INPUT); //pulled up by hardware
}
//////////////////////////////
void loop()
{
unsigned long currentMillis = millis();
if (digitalRead(ledSensorPin) == 0) ledHallState = 1;
if (digitalRead(ledSensorPin) == 1) ledHallState = 0;
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
//LED MOSFET SWITCH ON
if (ledHallState != ledLastHallState && ledHallState == 1) // Save current state as the last state
{
ledLastHallState = ledHallState; // Save current state as the last state
startCountDown = 0;
digitalWrite(led_mosfet, HIGH); // LED on
}
//LED MOSFET SWITCH OFF
if (ledHallState != ledLastHallState && ledHallState == 0) // Save current state as the last state
{
ledLastHallState = ledHallState;
previousMillis = currentMillis;
startCountDown = 1;
}
if (startCountDown == 1)
{
if(currentMillis - previousMillis > interval)
{
ledLastHallState =ledHallState;
digitalWrite(led_mosfet, LOW);
startCountDown = 0;
goToSleep();
}
}
}
Original issue reported on code.google.com by [email protected]
on 12 Feb 2014 at 5:46
What steps will reproduce the problem?
1.
String n = "320.23";
module.setDisplayToString (n);
What is the expected output? What do you see instead?
I Expected "320.23". In display appears "320 .23" the point should be appear in
the "0" digit (with point) and next character should be "2".
What version of the product are you using? On what operating system?
I use Windows 7 with 2.1.3 library.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 9 Sep 2013 at 6:50
Hello, Is it possible to display single segements of the numbers? I would like to use the chip to control leds instead of 7digits
I am implementing your library for an application i am developing where the buttons will be turning on relays in the application. Once a button is pressed i need the relay to turn on and then a CAN bus message is sent after that happens. I am using the code below to test the basic operation and i find that the serial window is getting constant messages every time i press a button.
I need my app to do a sub routine call only once for a given button press and only send the serial or CAN message only once. How would implement a button routine that latches the buttons in a way so i only get a single operation happening each time.
If i run the code below the serial window shows a constant stream of data with the case (last button pressed) being printed. It starts at case 0 and changes as i press the buttons but it does constantly send the serial messages which is not the behavior i need.
`#include <TM1638.h>
#include <InvertedTM1638.h>
#define NO_MODULES 1
// define a regular module and a inverted module
TM1638 module1(46, 47, 45);
InvertedTM1638 module2(45, 47, 46);
TM1638* modules[NO_MODULES] = {
&module1,
// &module2
};
byte modes[NO_MODULES];
unsigned long startTime;
void setup() {
Serial.begin(115200);
startTime = millis();
for (int i = 0; i < NO_MODULES; i++) {
modules[i]->setupDisplay(true, 7);
modes[i] = 0;
}
}
void update(TM1638* module, byte* mode) {
byte buttons = module->getButtons();
unsigned long runningSecs = (millis() - startTime) / 1000;
// button pressed - change mode
if (buttons != 0) {
*mode = buttons >> 1;
module->clearDisplay();
module->setLEDs(0);
}
switch (*mode) {
case 0:
module->setDisplayToDecNumber(runningSecs, 1 << 7);
Serial.println("case 0");
break;
case 1:
module->setDisplayToDecNumber(runningSecs, 1 << 6, false);
Serial.println("case 1");
break;
case 2:
module->setDisplayToHexNumber(runningSecs, 1 << 5);
Serial.println("case 3");
break;
case 4:
module->setDisplayToHexNumber(runningSecs, 1 << 4, false);
Serial.println("case 4");
break;
case 8:
module->setDisplayToBinNumber(runningSecs, 1 << 3);
Serial.println("case 8");
break;
case 16:
module->clearDisplayDigit((runningSecs - 1) % 8, 0);
module->setDisplayDigit(runningSecs % 8, runningSecs % 8, 0);
Serial.println("case 16");
break;
case 32:
char s[8];
sprintf(s, "Secs %03d", runningSecs % 999);
module->setDisplayToString(s);
Serial.println("case 32");
break;
case 64:
if (runningSecs % 2 == 0) {
module->setDisplayToString("TM1638 ");
} else {
module->setDisplayToString("LIBRARY ");
}
module->setLED(0, (runningSecs - 1) % 8);
module->setLED(1 + runningSecs % 3, runningSecs % 8);
Serial.println("case 64");
break;
case 65:
module->setDisplayToError();
Serial.println("case 65");
break;
}
}
void loop() {
for (int i = 0; i < NO_MODULES; i++) {
update(modules[i], &modes[i]);
}
}
`
In order to avoid the following compilation warning when using arduino-1.5.2
with Eclipse Arduino 2.x plugin (see [1]):
"Class 'TM16XX' has virtual method 'receive' but non-virtual
destructor TM16XX.h"
- the base class' default destructor shall be virtual and therefore to be
written explicitly.
Ref:
[1] Arduino Eclipse Plugin V2.x Installation (Eclipse Juno),
http://trippylighting.com/teensy-arduino-ect/arduino-eclipse-plugin/arduino-eclipse-plugin-installation/
Original issue reported on code.google.com by [email protected]
on 18 Aug 2013 at 9:57
Attachments:
Thanks for this great library. Among all those on the internet, it was the first one which immediately worked for me on an ESP32C6.
Since all examples are using polling to scan the button state, I wonder whether it's possible to be notified via IRQ when the button state changes or is it just not designed for that?
What steps will reproduce the problem?
1.Install Arduino 0023 on Win XP
2.Download TM1638 Library v2.0.0.zip and install it according to the
instructions
3.Open the example tm1638_one_module_example provided with the library, and
compile it inside Arduino IDE.
4. TM1638\TM16XX.cpp.o:(.rodata._ZTV6TM16XX+0x14): undefined reference to
`__cxa_pure_virtual'
What is the expected output? What do you see instead?
Binary sketch size: xxxx bytes (of a yyyy byte maximum)
What version of the product are you using? On what operating system?
Arduino 0023, Win XP
TM1638 Library v2.0.0.zip
Please provide any additional information below.
With the library 1.6, the same example compiles and links ok.
Original issue reported on code.google.com by [email protected]
on 12 Jan 2012 at 10:44
I'm trying to use some of my code that was written for the TM1638, on the TM1640
I'm only having this problem with this particular statement so far.
switch (Gear) { //Switch that displays correct gear on TM1638
case 102:{
//Reverse gear
gearDis.setDisplayToString("r",0,gearPos);
} break;
case 127:{
//Neutral gear
gearDis.setDisplayToString("n",0,gearPos);
} break;
case 149:
case 153:{ //First gear
gearDis.setDisplayDigit(1,gearPos,false);
} break;
case 170:
case 179:{ //Second gear
gearDis.setDisplayDigit(2,gearPos,false);
} break;
case 191:
case 204:{ //Third gear
gearDis.setDisplayDigit(3,gearPos,false);
} break;
case 213:
case 230:{ //Fourth gear
gearDis.setDisplayDigit(4,gearPos,false);
} break;
case 234:
case 255:{ //Fifth gear
gearDis.setDisplayDigit(5,gearPos,false);
} break;
}
Original issue reported on code.google.com by [email protected]
on 11 Jan 2012 at 8:10
What steps will reproduce the problem?
1.Try to compule the attached code
#include <TM1638.h>
TM1638 module(3, 2, 4);
String a = 0;
String b = 0;
String StringFinal = 0;
void setup() {
}
void loop() {
a = analogRead(1);
b = analogRead(3);
stringFinal = a+b;
module.setDisplayToString(stringFinal), 0xF0);
delay(100);
}
2.
3.
What is the expected output? What do you see instead?
The code should compile without errors.
The following errors are displayed:
error: no matching function for call to 'TM1638::setDisplayToString(String&, int)'
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 8 Oct 2011 at 4:26
For users that want to use the TM1638 to display temperature, it would be nice
to have the * character in the default font appear as follows instead of just
being blank:
0b01100011, // (42) *
Original issue reported on code.google.com by [email protected]
on 4 Dec 2011 at 2:09
hi all...
is possible to read data what coming out from Mcu to the IC.?
that mean read what data from Mcu to Mcu...
I know you wanted some more info on the TM1640 module for a possible library
build. Check this out!
http://club.dealextreme.com/forums/Forums.dx/threadid.1013434?page=2
Original issue reported on code.google.com by [email protected]
on 8 Jan 2012 at 9:56
What steps will reproduce the problem?
1. Load up your example named "tm1638_one_module_example"
2. Try to upload it to Arduino without modification or try to compile it.
What is the expected output? What do you see instead?
I guess it should compile and upload it to the Arduino. Instead it gives me
this error:
Error compiling.
TM1638\TM1638.cpp.o: In function `~TM1638':
D:\Program Files (x86)\Arduino-0023\libraries\TM1638/TM1638.cpp:55: undefined
reference to `operator delete(void*)'
What version of the product are you using? On what operating system?
- tm1638-library (v1.5.1)
- Windows 7 Ultimate x64
- Arduino 0023
- Arduino UNO
Original issue reported on code.google.com by [email protected]
on 5 Dec 2011 at 4:38
Attachments:
Hi
Great work on the library, Thank you!
Few observations while playing with my newly arrived tm1640:
1. If clearDisplay() is used then anything after that will not print to the
module. The fix is to use setupDisplay(), then consecutive print commands
appears on the LEDs.
2. If setupDisplay() is used then consecutive setDisplayToString() will produce
an extra character at the end of the string. If setupDisplay() is NOT used then
that extra character does not appear. The character is always the same - looks
like "L" shaped bracket. See pix.
Original issue reported on code.google.com by [email protected]
on 11 Mar 2012 at 11:54
Attachments:
I would like to publically upload it to Particle to allow others to use the library.
What is the expected output?
Dot's on display
Please provide any additional information below.
Would be nice to add this command so we can turn on any dot on display without
erasing existing content so that if i send string "234 TEST" and afterwards i
send module.setDots(0b01000000) i get on display "23.4 TEST"
Original issue reported on code.google.com by [email protected]
on 14 Nov 2011 at 2:28
What steps will reproduce the problem?
Any output to display.
What is the expected output? What do you see instead?
Expected: "01234567"
Reality: "45670123"
What version of the product are you using? On what operating system?
library version: 2.2.0
To solve this problem change following code in TM1638QYF.cpp in function
TM1638QYF::setDisplay:
change line:
sendData(i << 1, val);
... to:
sendData(i << 1, ((val & 0x0F) << 4) | ((val & 0xF0) >> 4)); // swap Hi-Lo nibble
Original issue reported on code.google.com by [email protected]
on 26 Jul 2015 at 6:23
I've used a logic analyzer to capture the DIO pin when receiving data with a TM1638, see here:
This was when pressing one key. As you can see, the DIO pin is changed on the falling edge of the clock. So you should move the digitalRead(dataPin)) in TM16XX.cpp after the digitalWrite(clockPin, HIGH) line, because then the data line has enough time to get stable, regardless of the clock speed (if within the maximum allowed 1 MHz, which is also not guaranteed in the library with very fast new Arduinos), and it would work more reliable even with the recommended 10k pullup resistors.
What steps will reproduce the problem?
1.char* zeropower = " 00 00";
2.module1.setDisplayToString(zeropower, 0b00100010);
3.
What is the expected output? What do you see instead?
- Expecting dots on the third and seventh digit. Seeing no dots. Works with
setDisplayToDecNumber and others, but need to use strings in my setup.
What version of the product are you using? On what operating system?
2.0.1 on Windows XP, Arduino Nano 3.0
Please provide any additional information below.
Thank you for your wonderful library. I am making speed/power/consumption meter
for my electric bike with TM1638 module using your libraries.
Original issue reported on code.google.com by [email protected]
on 18 Jan 2012 at 9:08
TM1638 library does not compile on ESP8266. While same library all example runs perfectly on Arduino Nano.
pasz1972/HassMqqtAlarmPanelTM1638#7
What steps will reproduce the problem?
1. myDisplay.setLED(TM1638_COLOR_GREEN, 7);
2.
3.
What is the expected output? What do you see instead?
LED 7 should become green, it becomes red instead.
What version of the product are you using? On what operating system?
Please provide any additional information below.
I suspect this is just my batch of boards, ref picture. I've added a #ifndef
section to invert the colours if TM1638_INVERT_LED is set.
#define TM1638_INVERT_LED 1
#include <TM1638.h>
Original issue reported on code.google.com by [email protected]
on 4 Feb 2013 at 11:41
Attachments:
What steps will reproduce the problem?
Run on TM1640:
byte values[] = { 73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73 };
module.setDisplay(values);
What is the expected output? What do you see instead?
Updates only the first 8 positions out of expected 16 positions.
What version of the product are you using? On what operating system?
TM1638 Library v2.1.3.zip with Arduino 1.0.3 environment.
Please provide any additional information below.
Partial fix is changing
virtual void setDisplay(const byte values[], unsigned int length = 8);
to
virtual void setDisplay(const byte values[], unsigned int length = 16);
in TM16XX.h
Original issue reported on code.google.com by [email protected]
on 25 Feb 2013 at 9:47
As describes in Issue 7, for users that want to use the TM1638 to display
temperature, it would be nice to have the * character in the default font
appear as follows:
-
| |
-
Original issue reported on code.google.com by [email protected]
on 4 Dec 2011 at 2:12
Attachments:
0xF0)); instead of 0xF));
Although the TM1638 library works fine on Windows, those using it on Linux,
BSD, Mac OS or other case-sensitive operating systems will find it fails at the
compilation stage.
Reproduce:
1. Unzip the library into the Arduino Libaries folder on Linux.
2. Load any of the TM1638 sample sketches.
3. Attempt to compile.
Instead of a successful compilation, you'll find it fails to find the String.h
library. There's a good reason for this: it's called string.h.
Thankfully, it's a simple fix. Line 23 of TM1638.cpp reads:
#include "String.h"
Modify this to read:
#include "string.h"
and the package compiles successfully.
Original issue reported on code.google.com by [email protected]
on 14 Nov 2011 at 8:43
Hi Ricardo,
I've got the TM1638/TM1640 library running on an ATtiny85.
I've tested with the TM1640, but have yet to try the TM1638.
http://www.instructables.com/id/Self-contained-16-Digit-display-Arduino-Attiny/
Are there any issues you can forsee with this library and the ATtiny85?
I've found the millis() function is 16 times too fast, due to the difference in
clock speeds (16Mhz vs 1Mhz). Nothing else has come up yet though.
Cheers!,
Panici
Original issue reported on code.google.com by [email protected]
on 17 Jan 2012 at 2:40
what happened to all the beautiful docs :(
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.