Using 'blink method' and 'blink without delay method' to make tones.

Lars81:

AWOL:

void withoutDelay(int interval){  

unsigned long currentMillis = millis();
  if(currentMillis - previousMillis > (interval / 2)) {
    previousMillis = millis();
    if(pinState == LOW) pinState = HIGH;
    else pinState = LOW;
    digitalWrite(outPin, pinState);
  }

}



And now?

Still the same..

Edit: I changed from using millis() to using micros() and scaling the interval accordingly, that seemed to fix the problem. Don't know why though :slight_smile: