Professional Documents
Culture Documents
4.1 Programul Software
4.1 Programul Software
1 Programul software
int buzzerPin = 8; //piezo buzzer pin
int micPin = 7; //sound detector pin
int pirPin = 6; //motion detector pin
int ledPin = 13; //led pin
int noteDuration = 0;
int pauseBetweenNotes = 0;
else{
digitalWrite(ledPin, LOW);
//stop the tone playing
noTone(buzzerPin);
}
}
void setup()
{ pinMode(buzzerPin,OUTPU
T); pinMode(ledPin,OUTPUT);
pinMode(pirPin,INPUT);
pinMode(micPin,INPUT);
}
void loop(){
pirState = digitalRead(pirPin);
micState = digitalRead(micPin);