int const led = 13;
int const pushbtn = 12;
int const pushbtn2 = 11;
int const buzzer = 10;
void setup() {
// put your setup code here, to run once:
pinMode(led, OUTPUT);
pinMode(pushbtn, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int btnValue = digitalRead(pushbtn);
Serial.println(btnValue);
if (btnValue == 1){
digitalWrite(led, HIGH);
}else{
digitalWrite(led, LOW);
}
int btnValue2 = digitalRead(pushbtn2);
Serial.println(btnValue2);
if (btnValue2 == 1){
tone(buzzer, 440 , 5);
}else{
digitalWrite(buzzer, LOW);
}
}