loop help !!

Hey guys

Am totally new to this and would like some help, So am using a couple of FSRs and i want once the force applied is more than 10 then two Piezoelectric Ultrasonic Speaker would emit a frequency range from 20kHz to 25kHz. Now to have a better performance i wanna put this in a loop that woud lets say last for a minute of emitting those frequencies. Am not sure how i can have these speakers emit those frequencies in an incremental way, like 20000 then 21000 and once it reaches 25000 it starts over from 20000 till the 1 min is over and it leaves the loop

This is the basic code i have which is just giving 20000 and 25000 but i want a way to cover all the frequencies within these ranges for a period of 1 min

if (fsrReading >= 10) {
Serial.println(" Object detected ");
tone(Repeller1, frequency1, 20000);
tone(Repeller1, frequency2, 25000);
delay(3000);

Thnx for ur any help provided

You could use for-loops:

for (int reps=0; reps<4; reps++) {
  for (int freq=20000; freq<=25000; freq+=1000) {
    tone(Repeller1, freq, 2000);
    delay(3000);
  }
}

However, using long delays within for loops can cause problems if you need your sketch to be doing other things at the same time…