#include <EtherCard.h>
boolean kapidurumu=0;
boolean sonkapidurumu=0;
boolean hareketdurumu=0;
boolean sonhareketdurumu=0;
boolean sesdurumu=0;
boolean sonsesdurumu=0;
const char apihost[] PROGMEM = “
www.notifymyandroid.com”;
static byte mymac[] = { 0x74, 0x69, 0x69, 0x2D, 0x30, 0x31 };
byte Ethernet::buffer[900];
Stash stash;
static byte session;
void setup () {
pinMode(6,INPUT); // HAREKET
pinMode(7,INPUT); // MIKNATIS
pinMode(9,INPUT); // SES
Serial.begin(57600);
Serial.println(“\nStarting Notify My Android Example”);
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
Serial.println(F(“Failed to access Ethernet controller”));
if (!ether.dhcpSetup())
Serial.println(F(“DHCP failed”));
ether.printIp(“IP: “, ether.myip);
ether.printIp(“GW: “, ether.gwip);
ether.printIp(“DNS: “, ether.dnsip);
if (!ether.dnsLookup(apihost))
Serial.println(F(“DNS lookup failed for the apihost”));
ether.printIp(“SRV: “, ether.hisip);
}
void loop () {
////////DURUM DEĞİŞİMİ ALGILAMA
//SENSÖRLERDEN SÜREKLİ GERİ BİLDİRİM ALINCA
///KODU ARKA ARKAYA ÇALIŞTIRMAK YERİNE
//SADECE LOJİK DURUMU DEĞİŞİNCE KODU ÇALIŞTIRMAK İSTİYORUZ…
//
kapidurumu = digitalRead(7); // O SEBEPLE ÖNCE SOLDAKİ DEĞİŞKENLERE
sesdurumu = digitalRead(9); // SENSÖRDEN GELEN GÜNCEL GERİBİLDİRİM
hareketdurumu = digitalRead(6);// DEĞERLERİ YAZDIRILIYOR…
if (hareketdurumu != sonhareketdurumu) { // DAHA SONRA GÜNCEL SENSÖR GERİBİLDİRİMİ SON KAYDEDİLEN
//SENSÖR GERİBİLDİRİMİ İLE KARŞILAŞTIRILIYOR. EĞER İKİSİ ARASINDA BİR DEĞİŞİKLİK ALGILANIRSA TELEFONA
//MESAJ GÖNDERME KISMINA GELİNİYOR.
if (hareketdurumu == HIGH) { //
Serial.println(“HAREKET”);
byte sd = stash.create();
stash.print(“apikey=”);
stash.print(“fee432b1eee0fb0c5afeb16207b1487be88b09e44eacefde”);
stash.print(“&application=”);
stash.print(“arduino”);
stash.print(“&event=”);
stash.print(“Arduino Guvenlik Sistemi”);
stash.print(“&description=”);
stash.print(“Hareket sensoru bir hareket algiladi!”);
stash.print(“&priority=”);
stash.print(“0”);
stash.save();
int stash_size = stash.size();
Stash:

repare(PSTR(“POST /publicapi/notify HTTP/1.1” “\r\n”
“Host: $F” “\r\n”
“Content-Length: $D” “\r\n”
“Content-Type: application/x-www-form-urlencoded” “\r\n”
“\r\n”
“$H”),
apihost, stash_size, sd);
session = ether.tcpSend();
}
}
if (kapidurumu != sonkapidurumu) {
if (kapidurumu== HIGH) {
Serial.println(“Kapı açık”);
byte sd = stash.create();
stash.print(“apikey=”);
stash.print(“fee432b1eee0fb0c5afeb16207b1487be88b09e44eacefde”);
stash.print(“&application=”);
stash.print(“arduino”);
stash.print(“&event=”);
stash.print(“Arduino Guvenlik Sistemi”);
stash.print(“&description=”);
stash.print(“Kapi veya Pencere Acildi!”);
stash.print(“&priority=”);
stash.print(“0”);
stash.save();
int stash_size = stash.size();
Stash:

repare(PSTR(“POST /publicapi/notify HTTP/1.1” “\r\n”
“Host: $F” “\r\n”
“Content-Length: $D” “\r\n”
“Content-Type: application/x-www-form-urlencoded” “\r\n”
“\r\n”
“$H”),
apihost, stash_size, sd);
session = ether.tcpSend();
}
}
if (sesdurumu != sonsesdurumu) {
if (sesdurumu ==HIGH) {
Serial.println(“SES”);
byte sd = stash.create();
stash.print(“apikey=”);
stash.print(“fee432b1eee0fb0c5afeb16207b1487be88b09e44eacefde”);
stash.print(“&application=”);
stash.print(“arduino”);
stash.print(“&event=”);
stash.print(“Arduino Guvenlik Sistemi”);
stash.print(“&description=”);
stash.print(“Ses sensoru ses algiladi!”);
stash.print(“&priority=”);
stash.print(“0”);
stash.save();
int stash_size = stash.size();
Stash:

repare(PSTR(“POST /publicapi/notify HTTP/1.1” “\r\n”
“Host: $F” “\r\n”
“Content-Length: $D” “\r\n”
“Content-Type: application/x-www-form-urlencoded” “\r\n”
“\r\n”
“$H”),
apihost, stash_size, sd);
session = ether.tcpSend();
}
}
ether.packetLoop(ether.packetReceive());
const char* reply = ether.tcpReply(session);
if (reply != 0) {
Serial.println(“Got a response!”);
Serial.println(reply);
}
sonhareketdurumu = hareketdurumu;
sonsesdurumu = sesdurumu;
sonkapidurumu = kapidurumu;
}
hocam kodlar bunlar kalın olarak gösterdiğim kod bloğunda hata veriyor. driver ı güncelledim. arduinonun kendi basit kodlarını atabiliyorum. ama bunu atamıyorum. tübitak projesi için mutlaka yapmam lazım ama hala çözemedim sorunu