Hey there, I am planning to make a birthday music cake with the function below :
I have 3 parts in the music cake :
1 -- > 7 LEDs as blinking circuit
2 --> 2 LEDs as candle to display flickering effect
3 -- > one speaker for music(happy birthday song)
So, I want to make it like this for the whole circuit :
1. Power ON -- > the blinking circuit start to blink with a pattern and 2 LEDs as candle will display flickering effect.
2. When a music button is pressed, the music played while the blinking still continue. Bear in mind that the music just play once when the music button is pressed.
3. when a pattern buttton is pressed, the pattern of the blinking 7 LEDs will changed.
Basically it is like this.
This is my programming code so far :https://gist.github.com/f616cb648830ac7fa4c9
For one button control different pattern of blinking , below is the progrramming code :https://gist.github.com/59e10280bfbe9fd9d9c8
I think I need tto use interrupt in this case for the music. Anyone can let me know how can I implement it ?
Thank you so much !