int notalar[] = {262, 294, 330, 349, 392, 440, 494}; int sira = 0; void setup() { pinMode(2, INPUT_PULLUP); } void loop() { if (digitalRead(2) == LOW) { sira = (sira + 1) % 7; delay(300); } tone(8, notalar[sira]); }