Two Arduinos!

Hi everyone,

I posted a little earlier about charlieplexing problems, well I have had a new idea.

I have inherited another Uno from a friend, could I theoretically do the 10 LED meter tutorial at http://arduino.cc/en/Tutorial/BarGraph with TWO arduinos and therefore TWENTY LEDs? or even 24 if we bring pins 12 and 13 in to play!

Does anyone have any advice about how I would go about doing that?

Would I just increase the array at the beginning of that code e.g:

int ledPins[] = { 2, 3, 4, 5, 6, 7,8,9,10,11 };

What numbers would I use to follow 11 if I wanted the next LED to be connected to pin 2 of the next arduino?

Also, do I hook the two arduinos up using the Rx Tx and GRD?

Thanks!

A single MAX7219 display driver chip using SPI (3 or 4 pins) can control 64 LEDs and uses only one resistor to set the LED current.

GF got there first but of course the MAX7219 is the most sensible way of doing this by multiplexing.

Aside from per-pin (20 mA) and total (200 mA IIRC) current limits on the MCU, two Arduinox would each have to run their own sketch and you would have to invent a communication between the two, possibly using their UARTs - or possibly other means.

In general, using multiple Arduinox makes things unnecessarily complex - you are certainly better off to use the MAX7219.

Hi guys,

Yeah I figured there would be components which would make my life easier, but I don’t really have time to order anything now.

So using two arduinos would be really hard?

Before your able to get the 2 Arduino's communication hashed out while running your sketches in sync the MAX7219 probably would have arrived and your project completed. 1 x Arduino + 1 x sketch = Less aspirin consumption

If you connect Rx to the other's Tx, and Tx to the other's Rx, and Gnd to Gnd, then one can send a simple message to two telling it how many LEDs to turn on. Two can receive the message and light up 1,2,3 etc LEDs as commanded.

westminster: So using two Arduinos would be really hard?

Come to think of it, no!

You want a bargraph, eh?

Well, if a bargraph like a LM3914 has an analog input and 10 LEDs, then to have 20 LEDs, you simply connect the same input to both, and have the second set (programmed) to offset the input by the value corresponding to full scale on the first. There is essentially no requirement for interconnection between the two (though the LM3914 actually has a cascade function as you will see on its datasheet).

For other functions, you may want some interconnection.

Where's the fun in that?