display

I got this display: http://www.ebay.de/itm/8-Bit-Digital-Tube-8-Bit-LED-8-Bit-Key-TM1638-module-for-Arduino-ARM-STM32-/130882198057?pt=Wissenschaftliche_Geräte&hash=item1e792fda29

I cant get anything on it, i have the arduino mega 2560 and a arduino uno, help.....

What voltage are you giving it?

i can run on 7 - 13 volt, i give it 12V

Ok, it looks at though it may need a library, you might need to contact the seller and see if it does in fact need one, and where to get it.

It looks like what you have is a serial I/O device that could be used with just about any microprocessor.

There are 8 push button switches that you can use as inputs to your microprocessor along with 8 LEDs and 8 seven-segment displays that can be used to display information from your microprocessor.

A datasheet is the bare minimum that an experienced programmer would need to use your device.

If you do a search for TM1638 you should find the same library that I found.

Don

i am a new with arduino, so any help is good??

I did the search Don recommended and found great info at GitHub - rjbatista/tm1638-library: Automatically exported from code.google.com/p/tm1638-library

In particular, the tm1638_one_module_example.pde indicates that, in addition to power, you'll need to connect the TM1638 data to arduino digital pin 8, the TM1638 clock to arduino digital pin 9 and the TM1638 strobe to arduino digital pin 7.

Make those connections and enter the example code.

/*
Library examples for TM1638.

Copyright (C) 2011 Ricardo Batista <rjbatista at gmail dot com>

This program is free software: you can redistribute it and/or modify it under the terms of the version 3 GNU General Public License as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <TM1638.h>

// define a module on data pin 8, clock pin 9 and strobe pin 7 TM1638 module(8, 9, 7);

void setup() {
  // display a hexadecimal number and set the left 4 dots
  module.setDisplayToHexNumber(0x1234ABCD, 0xF0);
}

void loop() {
  byte keys = module.getButtons();

  // light the first 4 red LEDs and the last 4 green LEDs as the buttons are pressed
  module.setLEDs(((keys & 0xF0) << 8) | (keys & 0xF));
}

Make sure you've got the TM1638 libraries installed and prepare to be wow'ed.

Nothing happens..

There are different tm1638 displays.

Mine has 8 red led on top and 8 (7 segment) display, and 8 buttons.

Your code compiles without errors?

Can you post a clear photo showing the wiring between the arduino and the display?

I have connected it this way:

VCC = 12 V
GND = it is also gnd on arduino mega
STB = Pin 7
CLK = Pin 9
DIO? = Pin 8

pins.jpg

board.jpg

The pictures aren't very clear. The yellow wire is connected between Data and digital pin 8? The purple/orange is CLK and digital pin 9? Red is STB and digital pin7?

I'm guessing that the 11.9 displayed in the upper right is your external 12 volt power supply? I can't see if the ground of this power supply is tied to the arduino ground. Is that the shadowy black wire upper left?

You've measured the 11.9 volts at the 1638 board?

You might be able to take a better picture if you put the arduino right next to the 1638 and used short jumpers to the three pins. From this picture, I can't tell one wire from another. Color coding wires is always a good idea. And I'm not sure which is red and which is orange.

The sample code above compiles error free?

No errors in program? ???? // define a module on data pin 8, clock pin 9 and strobe pin 7 TM1638 module(8, 9, 7);

what does this mean?

i connected the pins as i write:
VCC = 12 V
GND = it is also gnd on arduino mega
STB = Pin 7
CLK = Pin 9
DIO? = Pin 8

GND is also put to arduino GND

the Volt shows 11.9 volt, i cant make the wire short, the display pins is female and arduino is male....

It seems like I spend more time working on your project than you do. While it's true that some pictures are worth a thousand words, the two you posted together aren't going to exceed thirteen, tops.

There are basically three things that can be wrong:

  1. You've got a wiring error. A picture that clearly showed your wiring would help eliminate this as a problem. There are only 5 wires going to the display. There should be a sixth wire connecting the grounds. Without a clear picture of these, you're on your own.

  2. Your code is incorrect. The sample program here is very short and simple. When you compile this program, does it compile error free and download to the arduino error free? The library cited below notes that there are tm1638s with inverted logic. Have you checked to see if you have one of those versions by following his directions about interfacing using "InvertedTM1638.h" and "InvertedTM1638 module(8, 9, 7);"

  3. Your hardware is broken.
    3a. I assume that you've used your arduinos before and they've operated properly. If you're concerned that the arduino is the problem, you could blink LEDs from pins 7, 8, and 9 to be sure that those pins don't have a problem.
    3b. Your display is broken. I don't know of a simple test to eliminate this possibility.
    3c. Your external power supply is broken. If you're reading 11.9 volts, I think you can eliminate this possiblity.

No errors in program? ???? // define a module on data pin 8, clock pin 9 and strobe pin 7 TM1638 module(8, 9, 7);
Is your question "what does 'define a module'" mean? If so, it means you need to use the right set up for your display, either
**TM1638 module(8, 9, 7);**or
InvertedTM1638 module(8, 9, 7);
depending on which module you have

Hello to all?

I found out that it only needs 5 V to run and this program works? Not made by me..


#include <TM1638.h>

TM1638 tm (8, 9, 7);

unsigned long waitcheckTime=0;
unsigned long waitcheckButtons=0;

unsigned long intervalcheckTime=500;
unsigned long intervalcheckButtons=100;

unsigned long gapSecond=0;
boolean dots=0;

boolean moduleOff=0;

void setup(){
waitcheckTime = intervalcheckTime;
waitcheckButtons = intervalcheckButtons;
}

void loop(){
checkTime();
checkButtons();
}

void checkTime(){
if (millis() >= waitcheckTime) {
dots = !dots;
drawToModule();
waitcheckTime += intervalcheckTime;
}
}

void checkButtons(){
if (millis() >= waitcheckButtons) {
tm.setLEDs(0);
byte buttons=tm.getButtons();
if(buttons>0){
for (byte i=0;i<6;i++){
if ((buttons & 1<<i) != 0) {
buttonEvent(i);
waitcheckButtons +=intervalcheckButtons;
drawToModule();
}
}
}
waitcheckButtons +=intervalcheckButtons;
}
}

void drawToModule(){
if (!moduleOff){
unsigned long elapSecond = round(millis() / 500);
unsigned long totalSecond = gapSecond + elapSecond;
byte pos = totalSecond % 4;
if (pos>2) pos=1;
tm.clearDisplay();
tm.setDisplayToString(formatTime(totalSecond),(dots * 80),1);
}
}

void buttonEvent(byte inp){
tm.setLED((inp % 2 ) + 1,inp);
switch (inp) {
case 0:
if (hour(gapSecond) != 23) {
gapSecond += 3600 ;
}
else {
gapSecond -= 82800;
}
break;
case 1:
if (hour(gapSecond) != 0){
gapSecond -= 3600;
}
else{
gapSecond += 82800;
}
break;
case 2:
if (minute(gapSecond) != 59){
gapSecond += 60;
}
else{
gapSecond -= 3540;
}
break;
case 3:
if (minute(gapSecond) != 0){
gapSecond -= 60;
}
else{
gapSecond += 3540;
}
break;
case 4:
gapSecond -= second(gapSecond + round(millis() / 1000));
break;
case 5:
moduleOff = !moduleOff;
if (moduleOff) tm.clearDisplay();
break;
case 6:
break;
case 7:
break;
}
}

String formatTime(unsigned long inp){
return hourStr(inp) + minuteStr(inp) + secondStr(inp);
}

String formatNumber(String inp){
if (inp.length()==1) {
return "0" + inp;
}
else{
return inp;
}
}

String hourStr(unsigned long inp){
return formatNumber(String(hour(inp)));
}

String minuteStr(unsigned long inp){
return formatNumber(String(minute(inp)));
}

String secondStr(unsigned long inp){
return formatNumber(String(second(inp)));
}

byte hour(unsigned long inp){
return byte((inp/3600) % 24);
}

byte minute(unsigned long inp){
return byte((inp/60) % 60);
}

byte second(unsigned long inp){
return byte(inp % 60);
}