Hi. I am new to arduino and coding itself. I wonder how I can change animations on 4 LEDs anytime throughout the animations. I know how to make the animations, but not how to change them while playing another animation. If someone knows how I should do, please reply with how I should do or reply with a link to a subject with a solution.
Digital pin 2-5 are outputs (LEDs) and digital pins 6-9 are inputs (pushbuttons) I am using arduino UNO R3
-
Use a State Machine where each animation is a unique case.
-
Change the Machine state in your sketch to change the LED animation.
let me guess, your animation code is several pages long
Yes, because I just learned how to code.
good. it is time to learn cycles/loops.
flow chart diagram is very helpful for beginners, bc it require no programming knowledge.
btw, in case you want show here your code, place it between CODE tags.
Thanks for the quick help. I will try the solution and hope it works
- Always show us a schematic of your proposed circuit.
How do I show it
- Assuming you have accumulated enough time on this form, you can simply paste images in your posts.
ok.
- A gift for you:
- Assuming you have accumulated enough time on this form, you can simply paste images in your posts.
OR
Use the Upload icon.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.