датчик движения алярма итд... последний усовершенствованный код
Код: Выбрать все
/*
WiFi Web Server LED Blink
A simple web server that lets you blink an LED via the web.
This sketch will print the IP address of your WiFi Shield (once connected)
to the Serial monitor. From there, you can open that address in a web browser
to turn on and off the LED on pin 21.
If the IP address of your shield is yourAddress:
http://yourAddress/H turns the LED on
http://yourAddress/L turns it off
This example is written for a network using WPA encryption. For
WEP or WPA, change the Wifi.begin() call accordingly.
Circuit:
* WiFi shield attached
* LED attached to pin 21
created for arduino 221 Nov 2012
by Tom Igoe
ported for sparkfun esp32
31.01.2017 by Jan Hendrik Berlin
*/
#include <EEPROM.h>
#include <ArduinoOTA.h> // Библиотека для OTA-прошивки
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <FS.h>
#define tonePin D5 //d5
const char* ssid = "gansta-paradise.com";
const char* password = "123412345";
WiFiServer server(80);
File fsUploadFile;
#define DBG_OUTPUT_PORT Serial
int muzi ;
int pir = 0;
int alarma = 0;
int alarmaoff =0;
///////////hishpushk
#define A1_A D1 // выходы на драйвер
#define A1_B D2
#define AY_A D3 // выходы на драйвер
#define AY_B D4
#define PIR D0///datchik
void setup()
{
ESP.wdtDisable();
ESP.wdtEnable(WDTO_8S);
EEPROM.begin(3512);
muzi = EEPROM.read(100);
EEPROM.commit();
EEPROM.end();
Serial.begin(115200);
pinMode(PIR,INPUT);
pinMode(D6, OUTPUT); // set the LED pin mode
pinMode(D7, OUTPUT);
pinMode(D3, OUTPUT);
pinMode(D4, OUTPUT);
pinMode(D6, OUTPUT); // set the LED pin mode
pinMode(D8, OUTPUT);
delay(10);
// We start by connecting to a WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(2100);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
server.begin();
/// WiFi.mode(WIFI_STA);
// WiFi.begin(ssid, password);
/// while (WiFi.waitForConnectResult() != WL_CONNECTED) {
// delay(5000);
// ESP.restart();
// }
// ArduinoOTA.setHostname("Cepaum-Local"); // Задаем имя сетевого порта
///ArduinoOTA.setPassword((const char *)"0000"); // Задаем пароль доступа для удаленной прошивки
/// ArduinoOTA.begin(); // Инициализируем OTA
pinMode (A1_A, OUTPUT);
pinMode (tonePin, OUTPUT);
pinMode (A1_B, OUTPUT);
pinMode (AY_A, OUTPUT);
pinMode (AY_B, OUTPUT);
digitalWrite (A1_A, LOW);
digitalWrite (A1_B, LOW);
digitalWrite (AY_A, LOW);
digitalWrite (AY_B, LOW);
digitalWrite(tonePin,LOW);
}
int value = 0;
void loop(){
digitalWrite(tonePin,LOW);
ESP.wdtFeed();
pir = digitalRead(PIR);
//// Serial.println(pir);
/// Serial.println(pir);
if(alarmaoff==0){
if(pir>0){
Serial.println(pir);
//// pir = 0;
Serial.println("datchik srabotal");
Serial.println(pir);
tone(tonePin, 2793, 2571.426);
pir = 0;
alarma++;
}}
WiFiClient client = server.available(); // listen for incoming clients
if (client) { // if you get a client,
Serial.println("new client"); // print a message out the serial port
String currentLine = ""; // make a String to hold incoming data from the client
while (client.connected()) { // loop while the client's connected
if (client.available()) { // if there's bytes to read from the client,
char c = client.read(); // read a byte, then
Serial.write(c); // print it out the serial monitor
if (c == '\n') { // if the byte is a newline character
// if the current line is blank, you got two newline characters in a row.
// that's the end of the client HTTP request, so send a response:
if (currentLine.length() == 0) {
// HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
// and a content-type so the client knows what's coming, then a blank line:
client.println("HTTP/1.1 200 OK");
client.println("Content-type:text/html");
/// client.println("<style type=\"text/css\" >body {font-family: Georgia; color: purple; background-color: white}");
client.println();
client.println("<HTML>");
client.println("<HEAD>");
client.println("<style> body { background-color:green; }</style>");
client.println("<style> .cep { background-color:pink; }</style>");
client.println("<TITLE>GANSTA-PARADISE CEPAUM</TITLE>");
client.println("<link rel=\"stylesheet\" type=\"text/css\" href=\"http://gansta-paradise.com/cepaum/cepaum.css\" >");
client.println("<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"http://gansta-paradise.com/favicon.ico\">");
client.println("</HEAD>");
client.println("<BODY>");
// the content of the HTTP response follows the header:
client.println("<br>");
client.println("<p>");
EEPROM.begin(3512);
client.println(EEPROM.read(100));
EEPROM.commit();
EEPROM.end();
client.println(muzi);
client.println("</p>");
if (muzi<10){
client.println("<p >Bumer</p>");
}
if (muzi>=10&&muzi<15){
client.println("<p >Kasta</p>");
}
if (muzi>=15&&muzi<20){
client.println("<p >Beethoven</p>");}
if (muzi>20){
muzi = 10;
EEPROM.write(100, 0);
EEPROM.commit();
EEPROM.end();
}
client.println("<br>");
if(alarma>0){
client.println("<p >ALARMAAAA!!!!</p>");
alarma=0;
}
if(alarmaoff==0){
client.println("<p >ALARMA ON</p>");
}
if(alarmaoff==-1){
client.println("<p >ALARMA OFF</p>");
}
client.println("<br>");
client.println("<p class=\"t3\">VZORVATI PIDOROV</br> <a href=\"on1\"><button>ON</button></a> <a href=\"off1\"><button>OFF</button></a></p>");
client.println("<p class=\"t4\">OTA</br> <a href=\"OTA\"><button>ON</button></a> <a href=\"off2\"><button>OFF</button></a></p>");
client.println("<p class=\"t3\">OX</br> <a href=\"onl111\"><button>ON-X-Left</button></a> <a href=\"onr111\"><button>ON-X-right</button></a></p>");
client.println("<p class=\"t4\">OY</br> <a href=\"onYUP222\"><button>ON-Y-UP</button></a> <a href=\"onYDWN222\"><button>ON-Y-DWN</button></a></p>");
client.println("<p class=\"t4\">SIRENA</br> <a href=\"onSIREN\"><button>SIREN-ON</button></a> <a href=\"SIRENoff\"><button>ANTIKILLER</button></a></p>");
client.println("<h1 class=\"t5\">ZADEYSTVOVAT CEP</br> </h1>");
client.println("<p class=\"t1\"> </br> <a href=\"L\"><button class=\"cep0\">VVERH</button></a> <a href=\"H\"><button class=\"cep1\">OFF</button></a></p>");
client.println("<h1 class=\"t6\">REZHIMI</br> </h1>");
client.println("<p class=\"t2\"></br> <a href=\"X\"><button class=\"cep2\">OFF</button></a> <a href=\"Z\"><button class=\"cep3\">VNIZ</button></a></p>");
// The HTTP response ends with another blank line:
client.println();
// break out of the while loop:
break;
} else { // if you got a newline, then clear currentLine:
currentLine = "";
}
} else if (c != '\r') { // if you got anything else but a carriage return character,
currentLine += c; // add it to the end of the currentLine
}
// Check to see if the client request was "GET /H" or "GET /L":
if (currentLine.endsWith("GET /H")) {
digitalWrite(D6, LOW); // GET /H turns the LED on
}
if (currentLine.endsWith("GET /L")) {
digitalWrite(D6, HIGH); // GET /L turns the LED off
}
if (currentLine.endsWith("GET /Z")) {
digitalWrite(D7, HIGH); // GET /H turns the LED on
}
if (currentLine.endsWith("GET /X")) {
digitalWrite(D7, LOW);
}
/////////////////////////pushk//////////////////////////PUSHKA/////////////////////////////////
if (currentLine.endsWith("GET /onl111")) {
Serial.println(" levo ");
/// digitalWrite(diod, HIGH);
/////////////////////////////////////////////////timer///////////chobi ne otorvalo tebe zhopu uniy chkolo-ganster)))/////////33 minuti/////////////////////////////////
digitalWrite (A1_A, HIGH);
digitalWrite (A1_B, LOW);
delay(100);
// выключаем мотор
digitalWrite (A1_A, LOW);
digitalWrite (A1_B, LOW);
}
if (currentLine.endsWith("GET /onr111")) {
Serial.println(" pravo ");
digitalWrite (A1_A, LOW);
digitalWrite (A1_B, HIGH);
delay(100);
// выключаем мотор
digitalWrite (AY_A, LOW);
digitalWrite (AY_B, LOW);
}
if (currentLine.endsWith("GET /onYUP222")) {
Serial.println(" vverh ");
digitalWrite (AY_A, HIGH);
digitalWrite (AY_B, LOW);
delay(100);
// выключаем мотор
digitalWrite (AY_A, LOW);
digitalWrite (AY_B, LOW);
}
if (currentLine.endsWith("GET /onYDWN222")) {
Serial.println(" vniz ");
digitalWrite (AY_A, LOW);
digitalWrite (AY_B, HIGH);
delay(100);
// выключаем мотор
digitalWrite (AY_A, LOW);
digitalWrite (AY_B, LOW);
}
//////////////////////////////////////////////////////////SIRENA
if (currentLine.endsWith("GET /onSIREN")) {
Serial.println(" SIRENA ");
siren();
alarmaoff = ~alarmaoff;
Serial.println(alarmaoff);
}
if (currentLine.endsWith("GET /SIRENoff")) {
Serial.println(" SIRENA ");
muz();
}
////////////////////////////////////////////////////
if (currentLine.endsWith("GET /on1")) {
digitalWrite(D4, HIGH); muzi++; // GET /H turns the LED on
if (muzi<=10){
bumer ();
muzi++;
EEPROM.begin(3512);
EEPROM.write(100, muzi);
EEPROM.commit();
EEPROM.end();
}
if (muzi>=10&&muzi<15){
muz ();
muzi++;
EEPROM.begin(3512);
EEPROM.write(100, muzi);
EEPROM.commit();
EEPROM.end();
}
if (muzi>=15&&muzi<20){
dasboot ();
muzi = 10;
EEPROM.begin(3512);
EEPROM.write(100, muzi);
EEPROM.commit();
EEPROM.end();
}
}
if (currentLine.endsWith("GET /off1")) {
digitalWrite(D4, LOW); muzi--; // GET /L turns the LED off
if (muzi<10){
bumer ();
EEPROM.begin(3512);
EEPROM.write(100, muzi);
EEPROM.commit();
EEPROM.end();
}
if (muzi>=10&&muzi<15){
muz ();
EEPROM.begin(3512);
EEPROM.write(100, muzi);
EEPROM.commit();
EEPROM.end();
}
if (muzi>=15&&muzi<20){
dasboot ();
EEPROM.begin(3512);
EEPROM.write(100, muzi);
EEPROM.commit();
EEPROM.end();
}
}
////////////////////////OTA //////////////////////////////////////////////////////////////////ota////////////////////////////
if (currentLine.endsWith("GET /OTA")) {
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
delay(1000);
ESP.restart();
}
ArduinoOTA.setHostname("Cepaum-Local"); // Задаем имя сетевого порта
///ArduinoOTA.setPassword((const char *)"0000"); // Задаем пароль доступа для удаленной прошивки
ArduinoOTA.begin(); // Инициализируем OTA
Serial.println("");
Serial.println("OTA WAIT");
}
if (currentLine.endsWith("GET /off2")) {
digitalWrite(D3, LOW); muzi++; // GET /L turns the LED off
if (muzi<=10){
bumer ();
muzi++;
EEPROM.begin(3512);
EEPROM.write(100, muzi);
EEPROM.commit();
EEPROM.end();
}
if (muzi>=10&&muzi<15){
muz ();
muzi++;
EEPROM.begin(3512);
EEPROM.write(100, muzi);
EEPROM.commit();
EEPROM.end();
}
if (muzi>=15&&muzi<20){
dasboot ();
muzi = 10;
EEPROM.begin(3512);
EEPROM.write(100, muzi);
EEPROM.commit();
EEPROM.end();
}
}
}
}
// close the connection:
client.stop();
Serial.println("client disonnected");
}
client.println("</BODY>");
client.println("</HTML>");
}
void bumer (){
tone(tonePin, 1244, 156.2499375);
delay(173.611041667);
tone(tonePin, 1479, 624.99975);
delay(694.444166667);
delay(520.833125);
tone(tonePin, 1479, 156.2499375);
delay(173.611041667);
tone(tonePin, 1244, 624.99975);
delay(694.444166667);
delay(520.833125);
tone(tonePin, 1661, 156.2499375);
delay(173.611041667);
tone(tonePin, 1479, 156.2499375);
delay(173.611041667);
tone(tonePin, 1661, 156.2499375);
delay(173.611041667);
tone(tonePin, 1479, 156.2499375);
delay(173.611041667);
tone(tonePin, 1661, 156.2499375);
delay(173.611041667);
tone(tonePin, 1479, 156.2499375);
delay(173.611041667);
tone(tonePin, 1661, 156.2499375);
delay(173.611041667);
tone(tonePin, 1479, 156.2499375);
delay(173.611041667);
tone(tonePin, 1661, 156.2499375);
delay(173.611041667);
tone(tonePin, 1864, 624.99975);
delay(694.444166667);
delay(520.833125);
}
void dasboot(){
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 174, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 174, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 174, 263.15775);
delay(292.3975);
tone(tonePin, 233, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 174, 263.15775);
delay(292.3975);
tone(tonePin, 233, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 207, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 146, 263.15775);
delay(292.3975);
tone(tonePin, 207, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 110, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 329, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 131.578875);
delay(146.19875);
tone(tonePin, 329, 131.578875);
delay(146.19875);
tone(tonePin, 329, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 329, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 293, 131.578875);
delay(146.19875);
tone(tonePin, 329, 131.578875);
delay(146.19875);
tone(tonePin, 329, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 349, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 174, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 329, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 391, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 155, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 155, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 155, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 261, 131.578875);
delay(146.19875);
tone(tonePin, 311, 131.578875);
delay(146.19875);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 277, 263.15775);
delay(292.3975);
tone(tonePin, 155, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 277, 263.15775);
delay(292.3975);
tone(tonePin, 155, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 277, 263.15775);
delay(292.3975);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 277, 131.578875);
delay(146.19875);
tone(tonePin, 311, 131.578875);
delay(146.19875);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 207, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 97, 263.15775);
delay(292.3975);
tone(tonePin, 207, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 92, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 233, 263.15775);
delay(292.3975);
tone(tonePin, 146, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 233, 263.15775);
delay(292.3975);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 233, 263.15775);
delay(292.3975);
tone(tonePin, 146, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 233, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 184, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 146, 263.15775);
delay(292.3975);
tone(tonePin, 184, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 233, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 233, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 391, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 415, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 130, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 155, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 369, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 391, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 391, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 415, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 130, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 155, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 369, 263.15775);
delay(292.3975);
tone(tonePin, 261, 263.15775);
delay(292.3975);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 391, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 391, 263.15775);
delay(292.3975);
tone(tonePin, 233, 263.15775);
delay(292.3975);
tone(tonePin, 277, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 233, 263.15775);
delay(292.3975);
tone(tonePin, 277, 263.15775);
delay(292.3975);
tone(tonePin, 391, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 329, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 329, 263.15775);
delay(292.3975);
tone(tonePin, 349, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 174, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 311, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 233, 263.15775);
delay(292.3975);
tone(tonePin, 155, 263.15775);
delay(292.3975);
tone(tonePin, 195, 263.15775);
delay(292.3975);
tone(tonePin, 233, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 174, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 146, 263.15775);
delay(292.3975);
tone(tonePin, 174, 263.15775);
delay(292.3975);
tone(tonePin, 246, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 146, 263.15775);
delay(292.3975);
tone(tonePin, 174, 263.15775);
delay(292.3975);
tone(tonePin, 110, 263.15775);
delay(292.3975);
tone(tonePin, 146, 263.15775);
delay(292.3975);
tone(tonePin, 174, 263.15775);
delay(292.3975);
tone(tonePin, 110, 263.15775);
delay(292.3975);
tone(tonePin, 146, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 110, 263.15775);
delay(292.3975);
tone(tonePin, 138, 263.15775);
delay(292.3975);
tone(tonePin, 164, 263.15775);
delay(292.3975);
tone(tonePin, 146, 263.15775);
delay(292.3975);
tone(tonePin, 174, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 174, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 349, 263.15775);
delay(292.3975);
tone(tonePin, 440, 263.15775);
delay(292.3975);
tone(tonePin, 293, 263.15775);
delay(292.3975);
tone(tonePin, 349, 131.578875);
delay(146.19875);
tone(tonePin, 440, 131.578875);
delay(146.19875);
tone(tonePin, 440, 263.15775);
delay(292.3975);
tone(tonePin, 277, 263.15775);
delay(292.3975);
tone(tonePin, 391, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
delay(292.3975);
tone(tonePin, 277, 263.15775);
delay(292.3975);
tone(tonePin, 391, 263.15775);
delay(292.3975);
tone(tonePin, 220, 263.15775);
}
void muz(){
tone(tonePin, 466, 118.538519531);
delay(131.709466146);
delay(43.1462044271);
tone(tonePin, 523, 138.294939453);
delay(153.661043837);
delay(37.8475477431);
tone(tonePin, 554, 181.895314453);
delay(202.105904948);
delay(18.1668229167);
tone(tonePin, 523, 133.526148438);
delay(148.362387153);
delay(21.951577691);
tone(tonePin, 466, 131.482380859);
delay(146.091534288);
delay(53.7435177951);
tone(tonePin, 369, 334.496626953);
delay(371.662918837);
delay(18.1668229167);
tone(tonePin, 349, 1100.90946875);
delay(1223.23274306);
delay(100.674476997);
tone(tonePin, 554, 173.720244141);
delay(193.02249349);
delay(22.7085286458);
tone(tonePin, 622, 135.569916016);
delay(150.633240017);
delay(34.8197439236);
tone(tonePin, 554, 565.442363281);
delay(628.269292535);
delay(151.390190972);
tone(tonePin, 622, 143.744986328);
delay(159.716651476);
delay(35.5766948785);
tone(tonePin, 698, 146.470009766);
delay(162.744455295);
delay(33.3058420139);
tone(tonePin, 622, 393.084630859);
delay(436.760700955);
delay(30.2780381944);
tone(tonePin, 466, 119.90103125);
delay(133.223368056);
delay(34.8197439236);
tone(tonePin, 523, 132.163636719);
delay(146.848485243);
delay(18.1668229167);
tone(tonePin, 554, 153.963824219);
delay(171.070915799);
delay(17.4098719618);
tone(tonePin, 523, 142.382474609);
delay(158.202749566);
delay(21.951577691);
tone(tonePin, 466, 142.382474609);
delay(158.202749566);
delay(30.2780381944);
tone(tonePin, 369, 366.515652344);
delay(407.239613715);
delay(24.2224305556);
tone(tonePin, 349, 1499.44414648);
delay(1666.04905165);
delay(223.300531684);
tone(tonePin, 277, 508.898126953);
delay(565.442363281);
delay(15.8959700521);
tone(tonePin, 311, 658.093160156);
delay(731.214622396);
delay(68.1255859375);
tone(tonePin, 466, 118.538519531);
delay(131.709466146);
delay(43.1462044271);
tone(tonePin, 523, 138.294939453);
delay(153.661043837);
delay(37.8475477431);
tone(tonePin, 554, 181.895314453);
delay(202.105904948);
delay(18.1668229167);
tone(tonePin, 523, 133.526148438);
delay(148.362387153);
delay(21.951577691);
tone(tonePin, 466, 131.482380859);
delay(146.091534288);
delay(53.7435177951);
tone(tonePin, 369, 334.496626953);
delay(371.662918837);
delay(18.1668229167);
tone(tonePin, 349, 1100.90946875);
delay(1223.23274306);
delay(100.674476997);
tone(tonePin, 554, 173.720244141);
delay(193.02249349);
delay(22.7085286458);
tone(tonePin, 622, 135.569916016);
delay(150.633240017);
delay(34.8197439236);
tone(tonePin, 554, 565.442363281);
delay(628.269292535);
delay(116.570447049);
tone(tonePin, 622, 143.744986328);
delay(159.716651476);
delay(35.5766948785);
tone(tonePin, 698, 146.470009766);
delay(162.744455295);
delay(33.3058420139);
tone(tonePin, 622, 393.084630859);
delay(436.760700955);
delay(65.0977821181);
tone(tonePin, 466, 119.90103125);
delay(133.223368056);
delay(34.8197439236);
tone(tonePin, 523, 132.163636719);
delay(146.848485243);
delay(18.1668229167);
delay(188.48078776);
tone(tonePin, 554, 3.40627929688);
delay(3.78475477431);
tone(tonePin, 523, 138.976195313);
delay(154.417994792);
delay(21.951577691);
tone(tonePin, 466, 142.382474609);
delay(158.202749566);
delay(30.2780381944);
tone(tonePin, 369, 366.515652344);
delay(407.239613715);
delay(24.2224305556);
tone(tonePin, 349, 1499.44414648);
delay(1666.04905165);
delay(153.661043837);
tone(tonePin, 277, 570.211154297);
delay(633.567949219);
delay(17.4098719618);
tone(tonePin, 311, 658.093160156);
delay(731.214622396);
}
void siren() {
tone(tonePin, 2793, 2571.426);
delay(2857.14);
tone(tonePin, 3951, 241.0711875);
delay(267.856875);
delay(89.285625);
tone(tonePin, 3951, 160.714125);
delay(178.57125);
delay(178.57125);
tone(tonePin, 3951, 160.714125);
delay(178.57125);
delay(178.57125);
tone(tonePin, 3951, 241.0711875);
delay(267.856875);
delay(89.285625);
delay(2142.855);
tone(tonePin, 2793, 241.0711875);
delay(267.856875);
tone(tonePin, 3520, 401.7853125);
delay(446.428125);
}