       // went from off to on:
       Serial.println("on");
 
-      // Light the LED.
-      digitalWrite(LED_PIN, HIGH);
-      delay(100);
-      digitalWrite(LED_PIN, LOW);
-
     } else {
       Serial.println("off");
     }
+  }
+  lastButtonState = buttonState;
+
+  if (buttonState == HIGH) {
+    // Play a tone
+    tone(PIEZO_PIN, 200, 20);
+    // Light the LED.
+    digitalWrite(LED_PIN, HIGH);
     // Delay a little bit to avoid bouncing.
     delay(50);
+  } else {
+    digitalWrite(LED_PIN, LOW);
   }
-  lastButtonState = buttonState;
 }
const int BUTTON_PIN = 12;
const int LED_PIN = 13;

// See https://www.arduino.cc/en/Tutorial/StateChangeDetection


  pinMode(LED_PIN, OUTPUT);
  // Initialize serial communication for debugging.
  Serial.begin(9600);
}

int buttonState = 0;
