const int button = 6;
const int buzzer = 9;
int buttonstate = 0;
void setup() {
// put your setup code here, to run once:
pinMode(button, INPUT);
pinMode(buzzer, OUTPUT);
}
void loop() {
buttonstate = digitalRead(button);
if (buttonstate == HIGH) {
digitalWrite(buzzer, HIGH);
} else {
digitalWrite(buzzer, LOW);
}
}