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 :
- Power ON -- > the blinking circuit start to blink with a pattern and 2 LEDs as candle will display flickering effect.
- 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.
- 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 :
For one button control different pattern of blinking , below is the progrramming code :
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 !