Skip to content

tone function random crashes #52

Closed
@PaulStoffregen

Description

@PaulStoffregen

This sketch will crash after several minutes running on Arduino Zero. Serial output stops, and the frequency on pin 5 becomes approx 258 kHz.

void setup() {
  Serial.begin(115200);
  while (!Serial && millis() < 1500) ;
  delay(10);
  Serial.println("Tone Issue Test");
  delay(20);
}

void loop() {
  int frequency = 1500 + random(800);
  tone(5, frequency);
  Serial.println(frequency);
  delayMicroseconds(random(10000));
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions