rikveenboer / tm1638-library

Automatically exported from code.google.com/p/tm1638-library
0 stars 0 forks source link

Module declaration syntax #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 littleve...@gmail.com on 26 Oct 2014 at 4:02

GoogleCodeExporter commented 9 years ago
The problem is that the modules are defined with dynamic pin numbers for the 
support of several TMs under the same sketch... the use of defines for pin 
numbers doesn't really make sense with multiple modules, does it ?

The idea is that you can define several modules using specific pins for each 
(or sharing the clk and data for the chaining of (up to six) modules.

Like this:

// chain of two modules
TM1638 module1_1(53, 52, 51);
TM1638 module1_2(53, 52, 50);
// independent module
TM1638 module2_1(49, 48, 47);

Would the several defines help ?

Original comment by rjbati...@gmail.com on 27 Oct 2014 at 2:44