When I was browsing various web sites to see what electronic components to buy one day I noticed some interesting little kits comprising of switches, LEDs and a couple of 4 digit seven segment displays saw I decided to purchase one, the first thing I noticed was at the heart of the module was a chip called a TM1638, never heard of it. A quick search dug up links to the datasheet (link supplied underneath in the links section) and an arduino library (in the code section). That makes life easier.
The module I bought had 5 connections.
VCC – 5v from Arduino
Gnd – GND from Arduino
STB – strobe pin, an output from your Arduino
CLK – clock pin, an output from your Arduino
DIO – data pin, another ouput from your Arduino
You can get a library to make development easier from https://code.google.com/p/tm1638-library/
In the example below we use a couple of functions built into the library, there are various others that are available. We will count to 100 and then display a message.
setDisplayToDecNumber – Decimal numbers will be displayed
setDisplayToString – Displays some text on the segments
// define a module on data pin 8, clock pin 9 and strobe pin 10
TM1638 module(8, 9, 10);
unsigned long a=1;
for (a=1; a<=100; a++)