From cc0fc8c9ebc5a1e81afa3aa9c55e4970257c15b5 Mon Sep 17 00:00:00 2001 From: Omer SAVAS <iletisim@omersavas.com> Date: Thu, 4 Apr 2019 11:12:50 +0300 Subject: [PATCH] Upload New File --- Arduino/buzzer.ino | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Arduino/buzzer.ino diff --git a/Arduino/buzzer.ino b/Arduino/buzzer.ino new file mode 100644 index 0000000..ba5b384 --- /dev/null +++ b/Arduino/buzzer.ino @@ -0,0 +1,42 @@ +int sinyal = 7, buzzer = 8, role = 9; + +void cal() +{ + digitalWrite(role, HIGH); + + int t = 500; + for(int i = 0; i< 5; i++) + { + tone(buzzer, t); + delay(100); + t += 40; + noTone(buzzer); + delay(5); + } + + noTone(buzzer); + + digitalWrite(role, LOW); + /*delay(500); + digitalWrite(role, HIGH); + delay(500); + digitalWrite(role, LOW);*/ + +} + +void setup() { + delay(60000); + pinMode(sinyal, INPUT); + pinMode(buzzer, OUTPUT); + + pinMode(role, OUTPUT); + digitalWrite(role, LOW); +} + +void loop() +{ + if(digitalRead(sinyal)) + { + cal(); + } +} -- 2.18.1