Skip to content

Instantly share code, notes, and snippets.

@Sarverott
Created July 17, 2023 02:26
Show Gist options
  • Save Sarverott/b6b4991055e540a7ce923403a67ac58f to your computer and use it in GitHub Desktop.
Save Sarverott/b6b4991055e540a7ce923403a67ac58f to your computer and use it in GitHub Desktop.
project for digispark with Atmel ATTiny85, makes random noise, every pin (0-5) have to be conected with speaker or piezo
int randomSound, delayPeriod;
void setup() {
}
void loop() {
delayPeriod=random(1,10);
for(int pin=0;pin<6;pin++){
randomSound=random(20,1000);
noTone(pin);
tone(pin, randomSound, delayPeriod);
}
delay(delayPeriod);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment