Wow, I am understanding now, I think… I thought that I was initializing it with a value of 0
to start, since 2 lines right after you have this timer = millis();
I thought that what made the difference was this line you added in MAIN prog inside setup:
What does this mean exactly? that same line is inside the method, what is gained from putting it also inside void setup
in the main prog?
saying: that timer variable will be used here… equating both timers? hope I am being clear…
This from you Chrisir, I am trying to wrap my head around… to recap, trying to explain it to myself out loud:
Draw runs 60 frames por second. I am defining a new time within a function and I am calling that function within draw. If I have playNote
right after in draw, it will try to run 60 times per second, even thought the NOTE that it should play is coming from void iterate, which runs, is coming at a different rate(in this ex) interval = 5000;
playNote in draw will try to play the same note, 60 times per second even thought the value will not change and stays the same for 5 secs; only changes every 5 seconds. So the way I was doing it would be a waste of computing resources Is this understanding correct? Thank you Chrisir.