'Module_Init' was not declared in this scope hatası veriyor
%%%**ilk defa arduıno ya kod yazacağım ama böyle bir hata veriyo daha verdiği hatalar varda önce bunu yapmam gerekiyor.**%%%%yardım ederseniz sevinirim
#include <Sim800L.h>
#include <SoftwareSerial.h>
#include <String.h>
SoftwareSerial gprsSerial(10, 11);
void ShowSerialData();
void ModuleInit();
void setup();
{
pinMode(12, OUTPUT);
pinMode(9, INPUT);
gprsSerial.begin(9600); // the GPRS baud rate
Serial.begin(9600); // the GPRS baud rate
Module_Init();
}
gprsSerial.println("AT");
delay(1000);
gprsSerial.println("AT+CPIN?");
delay(1000);
gprsSerial.println("AT+CREG?");
delay(1000);
gprsSerial.println("AT+CGATT?");
delay(1000);
gprsSerial.println("AT+CIPSHUT");
delay(1000);
gprsSerial.println("AT+CIPSTATUS");
delay(2000);
gprsSerial.println("AT+CIPMUX=0");
delay(2000);
ShowSerialData();
gprsSerial.println("AT+CSTT=\"www\"");
delay(1000);
ShowSerialData();
gprsSerial.println("AT+CIICR");
delay(3000);
ShowSerialData();
gprsSerial.println("AT+CIFSR");
delay(2000);
ShowSerialData();
gprsSerial.println("AT+CIPSPRT=0");
delay(3000);
ShowSerialData();
}
int fire = digitalRead(12);
gprsSerial.println("AT+CIPSTART=\"TCP\",\"api.thingspeak.com\",\"80\"");//start up the connection
delay(6000);
ShowSerialData();
gprsSerial.println("AT+CIPSEND");//begin send data to remote server
delay(4000);
ShowSerialData();
String str = "GET https://api.thingspeak.com/update?api_key=xxxxxxxxxxxxxxxxxxx=" + String(1);
Serial.println(str);
gprsSerial.println(str);//begin send data to remote server
gprsSerial.println("AT+CIPSHUT");//close the connection
delay(100);
#include <SoftwareSerial.h>
SoftwareSerial gprsSerial(10, 11);
#include <String.h>
int flag = 0;
void setup()
{
pinMode(9, OUTPUT);
pinMode(12, INPUT);
gprsSerial.begin(9600); // the GPRS baud rate
Serial.begin(9600); // the GPRS baud rate
Module_Init();
}
void loop()
{
if (gprsSerial.available())
Serial.write(gprsSerial.read());
int fire = digitalRead(12);
if (fire == 0)
{
digitalWrite(9, HIGH);
gprsSerial.println("AT+CIPSTART=\"TCP\",\"api.thingspeak.com\",\"80\"");//start up the connection
delay(6000);
ShowSerialData();
gprsSerial.println("AT+CIPSEND");//begin send data to remote server
delay(4000);
ShowSerialData();
String str = "GET https://api.thingspeak.com/update?api_key=xxxxxxxxxxxxxxxxxx=" + String(1);
Serial.println(str);
gprsSerial.println(str);//begin send data to remote server
delay(4000);
ShowSerialData();
digitalWrite(9, LOW);
gprsSerial.println((char)26);//sending
delay(5000);//waitting for reply, important! the time is base on the condition of internet
gprsSerial.println();
ShowSerialData();
gprsSerial.println("AT+CIPSHUT");//close the connection
delay(100);
ShowSerialData();
flag = 0;
}
else
{
digitalWrite(9, LOW);
if (flag == 0)
{
flag = 1;
gprsSerial.println("AT+CIPSTART=\"TCP\",\"api.thingspeak.com\",\"80\"");//start up the connection
delay(6000);
ShowSerialData();
gprsSerial.println("AT+CIPSEND");//begin send data to remote server
delay(4000);
ShowSerialData();
String str = "GET https://api.thingspeak.com/update?api_key=xxxxxxxxxxxxxxxxxxx=" + String(0);
Serial.println(str);
gprsSerial.println(str);//begin send data to remote server
delay(4000);
ShowSerialData();
digitalWrite(9, LOW);
gprsSerial.println((char)26);//sending
delay(5000);//waitting for reply, important! the time is base on the condition of internet
gprsSerial.println();
ShowSerialData();
gprsSerial.println("AT+CIPSHUT");//close the connection
delay(100);
ShowSerialData();
}
}
}
void ShowSerialData()
{
while (gprsSerial.available() != 0)
Serial.write(gprsSerial.read());
delay(5000);
}
void Module_Init()
{
gprsSerial.println("AT");
delay(1000);
gprsSerial.println("AT+CPIN?");
delay(1000);
gprsSerial.println("AT+CREG?");
delay(1000);
gprsSerial.println("AT+CGATT?");
delay(1000);
gprsSerial.println("AT+CIPSHUT");
delay(1000);
gprsSerial.println("AT+CIPSTATUS");
delay(2000);
gprsSerial.println("AT+CIPMUX=0");
delay(2000);
ShowSerialData();
gprsSerial.println("AT+CSTT=\"www\"");
delay(1000);
ShowSerialData();
gprsSerial.println("AT+CIICR");
delay(3000);
ShowSerialData();
gprsSerial.println("AT+CIFSR");
delay(2000);
ShowSerialData();
gprsSerial.println("AT+CIPSPRT=0");
delay(3000);
ShowSerialData();
}
Son Giriş: 2 yıl önce
Son Mesaj Zamanı: 3 yıl
Mesaj Sayısı: 2
Gerçek Toplam Mesaj Sayısı: 2
İkinci El Bölümü Mesajları: 0
Konularının görüntülenme sayısı: 225 (Bu ay: 2)
Toplam aldığı artı oy sayısı: 0 (Bu hafta: 0)
En çok mesaj yazdığı forum bölümü: Yazılım Geliştirme