Arduino interacting with a TM1638 module using tm1638-lib-v1.0.0

preview_player
Показать описание
Arduino interacting with a TM1638 module using my library v1.0.0

The library is available at:

A library for interacting an arduino with a tm1638.
* Helper methods for displaying numbers in decimal, hexadecimal and binary;
* Support for multiple chained tm1638;
* Reading simultaneous button presses;
* Support for dimming the display and LEDs.

The tm1638 module is available at:
Рекомендации по теме
Комментарии
Автор

@umloginqualquer

This is a TM1638 module. It's a module with 8 buttons, 8 red LEDs, 8 green LEDs and 8 7-segment display digits controlled by a TM1638 chip with a 10 pin I/O - it's chain-able module of up to 6 modules.

Basically, you just have to connect Vcc/Gnd, a data pin, a clock pin and a strobe pin (1 pin for each chained module) directly to your Arduino, import my library, specify the pins you used and you're done! :) It's a nice module to use as an helper - only 3 pins for one module.

ricardojbatista
Автор

@MrTimmiej It's not "confined" to 0-F... that's what an hexadecimal number is.

You should use this for hex numbers:
module.setDisplayToHexNumber(0x1A, 0);

You should use this for decimal numbers:
module.setDisplayToDecNumber(5638, 0);

You should use this for binary numbers:
module.setDisplayToBinNumber(0b10101010, 0);

You should use this for text:
bla ");

ricardojbatista
Автор

You can specify the pins you want to use in the module instantiation. There are no specific pins. The project page has an image with the pin-out of the module itself.

ricardojbatista
Автор

@ricardojbatista I cant realize how to change position of DecNumbers... in ( 10, 0, false ) the 0 changes only the dot position...and it's quite annoying :) !! Any suggestions? Thank you anyway.

Vectorrr
Автор

@ricardojbatista Hi Riccardo, i'v tried to usr setDisplayToString, but it allows me to print only 1 string per time...

I must make a timer.... so i must print:

mm:ss:msms

But only mm or ss or ms are shown

Vectorrr
Автор

@chartle1 I'm the author of the google code project. But I don't understand your question. The code site has the pinout for the module and the schematics for connecting up to six modules. I'll be glad to help you, but I don't understand what you need.

ricardojbatista
Автор

Did you wire the display directly to Arduino, or you needed some kind of

umloginqualquer
Автор

I guess from looking over the code and rereading the above reply to umloginqualqer I think I have figured it out. What I was originally looking for was how a Arduino interfaced with the module pin to pin. You have a great pic labeling the header but not how those pins connect to the Arduino headers. Now that I have read the comment above mine I see how it connects. I'm assuming that the defined data pin in the code goes to DIO and there is only one data and one clock signal per chain. thanks

chartle
Автор

@ricardojbatista Where can I find this hook up diagram. I have searched and even went to the authors code.google page I can find everything but that. It has a schematic but its chip to chip do pin to pin.

I have one on order from DX I ordered a week ago so I guess I have at least 2 more weeks to figure it out.

chartle
Автор

@MrTimmiej There is a way to turn off the leading zeros in version 1.3.0 and there are some examples that come with the library.

For instance:

module.setDisplayToDecNumber(123, 0, false);

would display 123 without the leading zeros.

Try out the examples on the arduino IDE (Menu: File->Examples->TM1638). I'll try to make a new example when I can afford the time. :)

ricardojbatista
Автор

@Vectorrr The function "setDisplayToDecNumber" always displays the number right justified. The second argument is the dot bitset and not the number position. You can check out the library reference on the project site.
I can suggest 2 options:
- use the "setDisplayToString" with the string containing the number wherever you want to display it.
- create an issue with your suggestions on the project site and I'll try to look into it when I can find some time :-).

ricardojbatista
Автор

what the pin lay out from the arduino to it, i have arduino nano, im new this is any help

coconutjoe