Hello I m new to the forum , i would like specific parts of my code to run for certain time. I m using a wave.square function with minima r4 and i would like to run wave.square for a certain frequency for 2 minutes and then change the frequency and run the wave.square for another 2 minutes and ect. I tried using elapsedTime library and wave.freq(freq) and changing the freq each time but the frequency never changed. Is it a better way of succeeding this or is something wrong with my code?
Welcome to the forum
Please post your attempt at doing what you want
1 Like
Please show your code.
Why is it so common on these forums for people to expect help with their code without first showing their code?
Total lack of thinking, or not knowing that Crystal balls stoped working when the last forum update happened.
1 Like
You can use the milis() function and simple arithmetic to calculate elapsed time. NOTE: all of the variables related to this MUST be declared and “long int”.
All of the variables related to this MUST be declared as long unsigned int
The difference is important
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.