hello! I'm working on a project with the arduino micro and I need to produce a random hertz for X amount of time on pin 11 then switch to pin 12
unsigned long lastEdge;
void setup() {
pinMode(11, OUTPUT);
}
void loop() {
unsigned long topLoop = micros();
if (topLoop - lastEdge > random(1,5000)) { // 1000000 / (55 * 2)
digitalWrite(11, !digitalRead(11));
lastEdge = topLoop;
}
}
help!