is it possible that two Arduino's could send data to one neopixel led strip?
what I want to happen is that the two Arduino's switch between who Is sending.
for example, Arduino 1 is sending data and they switch after 30 seconds, now Arduino 1 has stopped sending data and Arduino 2 is sending data. then after 30 seconds, they switch again. This repeats over and over.
You can’t connect two outputs together so you must combine the signals somehow.
You can use a data select circuit made from four NAND or NOR gates ( one package ).
The data signal is normally high and gets pulled low so you could combine the signals with two open collector buffers and a pull up resistor.
However synchronising between two Arduinos can be tricky.
Why do you want to use two Arduinos anyway? Most problems can be tackled with one and it is a classic beginners mistake to consider using two.
Grumpy_Mike:
You can’t connect two outputs together so you must combine the signals somehow.
You can use a data select circuit made from four NAND or NOR gates ( one package ).
The data signal is normally high and gets pulled low so you could combine the signals with two open collector buffers and a pull up resistor.
However synchronising between two Arduinos can be tricky.
good to know. but could you draw me an example schematic?
I don't know how I could make such a circuit.
what I want is that the Arduino's don't send out at the same time. that's what I'm trying to say.
Grumpy_Mike:
Why do you want to use two Arduinos anyway? Most problems can be tackled with one and it is a classic beginners mistake to consider using two.
I know that but on one Arduino I have a program that uses almost all the programming space. and this in my other knowledge couldn't find a way to reduce this. the code
So i had no space left for other animations and needed another Arduino.
If your code is only 3.61 KB then you should post it here if you want to discuss how to implement it. OK, I peeked - it seems you are reading data from an SD card. I can't see why it would occupy so much space. There does seem to be a code problem rather than a hardware issue.
If you really are short on code space, a good answer is to use an ESP8266 instead but simply ignore (switch off) its WiFi functionality. It is immensely cheaper than a larger Arduino and much more compact to boot as I suspect you desire.
A WeMOS D1 Mini would be a good board for the job! You will need a 74HCT14 buffer to drive NeoPixels.
I know that but on one Arduino I have a program that uses almost all the programming space
When I compiled it I got
Sketch uses 14930 bytes (46%) of program storage space. Maximum is 32256 bytes.
Which is nowhere close to being all.
However, the dynamic memory is another matter:-
Global variables use 2075 bytes (101%) of dynamic memory, leaving -27 bytes for local variables. Maximum is 2048 bytes.
Which suggest you need more sram not another Uno. There are Arduinos with more memory, Paul mentioned just a few.
However the large number of LEDs are a problem. You have 360 LEDs and at a maximum of 60mA per LED this requires a current of 21.6 Amps. I note that you are reducing the brightness by a third so that reduces the maximum current to 7.2 Amps, but all from a USB socket!
Paul__B:
If your code is only 3.61 KB then you should post it here if you want to discuss how to implement it. OK, I peeked - it seems you are reading data from an SD card. I can't see why it would occupy so much space. There does seem to be a code problem rather than a hardware issue.
One problem I see is that there are two files open at once, which will allocate a lot of ram for file buffers. One is for searching the directory and the other for the actual data file, and could likely be reduced to only needing a single file open at a time.
If you are willing to use consistent and predictable names for your animation files, such as 001.BIN, 002,BIN, 003.BIN, etc, then there is really no need to do a directory search. Just start with the first file name, and open them sequentially, checking each time to see if the file actually exists.