Question about having more I/O pins on arduino.

PaulRB:
Yes, you could be right about that. Perhaps it would be worth experimenting. You could use pots to adjust the current to each of your different colour leds. Make them all, say, 10mA, and see if the difference in brightness is acceptable or not.

but one more problem, it will be a mix of Common Anode and Common Cathode :confused:
3 MAX7219, 1 for double digits CA displays, 1 for single digit CA display and 1 for LEDs common cathode of course

PaulRB:
I agree, I think such libraries would not work with a mix of max7219 and 74xx595 chips daisy-chained together. You would either have to change those libraries in some way, or not use libraries at all, but write your own code to send data to the chain of chips, knowing how the chain is constructed. This could be done. I have used max7219 chips without using a library, and 74xx595 chips are easy to use without a library.

well that would be a problem :confused: because i can't work with this without the library i am new to it and there is no real tutorials that explains how it really work at least i didn't find so far

i know how to work with the 595 only

firashelou:
there is no real tutorials that explains how it really work

Normally these 'tutorials' are called datasheets or application notes, aren't they? :wink:

And you have the source code of the libraries...

You would have to seperate the data generation from the datatransmission,
concatenate the data in the right order and have a transmitter send all together.

Whandall:
Normally these 'tutorials' are called datasheets or application notes, aren't they? :wink:

And you have the source code of the libraries...

You would have to seperate the data generation from the datatransmission,
concatenate the data in the right order and have a transmitter send all together.

aha but i am just an amateur :confused:

about the library i tried to read it, it's deep C programming which i don't know :frowning: so must learn C first but for now i don't have time because i am working on the structure mechanical part and electronics part ! 1 person 2 functions :stuck_out_tongue:

So missing knowledge costs pins. :wink: You just don't get something for nothing.

Not a big deal, as cascading of identical chips is usally supported in the libraries.

Whandall:
So missing knowledge costs pins. :wink: You just don't get something for nothing.

so far i came a long long way :D, my before prototype contained tones of 595, transistors and capacitors just for the 595s and 3 arduinos but now it shrank :wink:

Whandall:
Not a big deal, as cascading of identical chips is usally supported in the libraries.

what do you mean ?

Daisychaining/cascading of MAX7219s is supported by the library.
Same probably holds true for the shiftregisters but I did not use them yet, so I can not be shure.

So if you do not want to change the libraries you cant concatenate all serial devices,
but only the identical ones (still sparing pins).

To save the biggest number of pins (cascading everything) you can indeed not use the normal libraries. Do it yourself or altering a library required. (Mayby put it into a buffer instead of sending it out.) But indeed, 595 and the MAX7219 are not that hard...

But you can probably get away with using the same Data en clock line for the MAX7219 and 595 but a separate latch line and still use the libaries.

So it's a choice you have to make. A little bit of extra work in coding (but he, the MAX7219 isn't that hard) or use more IO. But with some good code you can use all the 595, 4021 and the MAX7119 with just 4 lines (MOSI, MISO, SCK and Latch).

About the tacho, I did not know this was external data via wireless. All I read was inputs via the 4021 and read tacho data that way is a bad idea :stuck_out_tongue:

you are totally right guys, that's why it seems that i got hit by "Interesting" that i started to search for good books to choose one to learn the C language
i got this one on my hands for now "The C programming Language by Kernighan and Ritchie"

If you have a good book for C, share the title please because i would be interested

firashelou:
i got this one on my hands for now "The C programming Language by Kernighan and Ritchie"

That's the original C bible. But it won't help you much with all the C++ object-oriented stuff.

PaulRB:
That's the original C bible. But it won't help you much with all the C++ object-oriented stuff.

C++ ! you mean i must learn C++ and not C ?

firashelou:
C++ ! you mean i must learn C++ and not C ?

C++ is based on C. If you learn and write code in C, it will compile & run OK on Arduino. But you can make life easier for yourself by learning some C++ also. You only need to be an expert in C++ if you want to write your own libraries, or write your code in an object-oriented fashion.

There is another way to get more analog and digital inputs and outputs connected to an Arduino that we have not yet talked about. It is called i2c and it is a type of "bus". A bus is where the same pins are used to communicate with several other chips or components. This uses only two Arduino pins and you can connect chips with extra analog inputs, or with extra digtal inputs & outputs. For example you could have a chip with 8 analog inputs, and a few chips with a mix of inputs and outputs, and connect them all to the same 2 Arduino pins.

But if you already have 595, 4021 and 7219 I'll stick to that... It's not that much easier...

But yeay, C++. And the internet is full with help :slight_smile: Just Google :smiley:

PaulRB:
C++ is based on C. If you learn and write code in C, it will compile & run OK on Arduino. But you can make life easier for yourself by learning some C++ also. You only need to be an expert in C++ if you want to write your own libraries, or write your code in an object-oriented fashion.

i remember i started with C++ 5 years ago but never continued after i watched 1 tutorial i jumped to PHP which i learned and had fun with and after javascript which the more fun and now i should get back to C++ lol, i will continue my C learning i like it and after check the C++

PaulRB:
There is another way to get more analog and digital inputs and outputs connected to an Arduino that we have not yet talked about. It is called i2c and it is a type of "bus". A bus is where the same pins are used to communicate with several other chips or components. This uses only two Arduino pins and you can connect chips with extra analog inputs, or with extra digtal inputs & outputs. For example you could have a chip with 8 analog inputs, and a few chips with a mix of inputs and outputs, and connect them all to the same 2 Arduino pins.

i have heard of i2c master/slave but never worked with it so if you say it may help then yes why not will do it

but how 2 pins ? a shift register needs at least 3 to function :confused:

firashelou:
but how 2 pins ? a shift register needs at least 3 to function :confused:

The famous WS2812 RGB-leds function like shift registers and need only one pin. :wink:

Whandall:
The famous WS2812 RGB-leds function like shift registers and need only one pin. :wink:

ok but that's different because i am talking about specific registers like 595 and max7219 :o

I could not guess that the term 'a shift register' means only those.

Whandall:
I could not guess that the term 'a shift register' means only those.

right no, but in my case here i was referring to those :smiley:
unless if there is another shift register that can drive independent LEDs with only 1 pin?

You can have multiple groups of '595, '7219, etc. all connected in parallel to SCK & MOSI - each group then just needs a unique chip select line to address it. Does that qualify as 1 pin?
WS2811 is similar to WS2812 for driving 3 LEDs with just 1 wire - it does not have integrated LEDs so you can use your own.

WS2811-preliminary.pdf (320 KB)

WS2812B.pdf (381 KB)

CrossRoads:
You can have multiple groups of '595, '7219, etc. all connected in parallel to SCK & MOSI - each group then just needs a unique chip select line to address it. Does that qualify as 1 pin?
WS2811 is similar to WS2812 for driving 3 LEDs with just 1 wire - it does not have integrated LEDs so you can use your own.

ah so it's just a 3 LEDs output

Is it possible if i am working I2C method, to make connection between 2 standalone arduinos ? or there is some sort of hardware on the board that is needed ?