Hi
Here is the thing i'm trying to do
I'd like to make an Arduino I2C master trigger events at specific time following a sequence.
The idea is to have this sequence starting when I'm pushing on a button
For example, the button connected to the arduino uno master is pressed then it turns on a led strip connected to a slave arduino uno, after a specific timing it plays a tune on mp3 player connected to another arduino uno slave and so on...
I checked this multitasking guide (Overview | Multi-tasking the Arduino - Part 1 | Adafruit Learning System) but get quite confused because I don't need to repeat the event.
Any clues ?
Thanks in advance !
Welcome to the forum
Why use slave boards rather than a single Arduino ?
If you decide to use slave boards how are you going to communicate with them?
"How?"
The subject title: I2C.
Don't.
You detect that the button was pressed, send a "command" to the first slave to turn on the LED strip, and start your time based on millis() (T0).
When T1 is fulfilled you send the command to the second slave to play a tone.
When T2 is fulfilled, you send the command to the third slave so that...
When the whole sequence ends, you just wait for the button to be pressed again.
You can use a state machine or not, it's up to taste.
Regards
Note that you will need feedback from the slave in order to do this
Not while time is controlled by the master.
OK, so the master says to the slave "do this for 10 seconds", the slave tries to do "this" and cannot. If the slave does not report success to the master then the action will be assumed to have happened even though it is not true
Of course, this may not matter, but if the next action depends on the first one having been completed then it will matter
As it is we do not know what the exact requirement is nor why a master and several slave Arduinos are required anyway
Totally agree with you but my post is only a guide to the minimum steps that the PO should follow to do what it needs, it is in he to deepen.
Regards
Ok thanks for your help !
I just found this and it's been super helpfull !
cheers
Please explain why you need to use multiple Arduinos
OK I need several arduinos because I'd like to light up several led strips, activate relays, play tunes with a audioplayer and all this doesn't fit in one arduino uno.
Are you sure that you need multiple LED strips ? You can control sections of an addressable LED strip as if they were separate strips and the whole strip can be as many LEDs as you like. All of that only needs a single pin to control it.
How many relays do you need to control, bearing in mind that they only take a single pin each ?
How many pins does the audio player need ? Probably 4 at max and possibly fewer
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.