kodumda bu hatayla karşılaşıyorum yardım ederseniz sevinirim. kodum burada: #include <TinyGPS++.h> #include <Wire.h> #include <SoftwareSerial.h> #include<LiquidCrystal.h> #include <MPU6050.h> #define button1 9 #define button2 10 SoftwareSerial sim800l(7, 8); MPU6050 sensor ; int16_t ax, ay, az ; int16_t gx, gy, gz ; //////////// AYARLAR ///////////// int bekle = 0 ; int gyro_max = 80 ; int gyro_min = 180 ; int ivme_esik = 20000 ; //////////// AYARLAR ///////////// bool button_State; bool button_State2; static const int RXPin = 4, TXPin = 3; static const uint32_t GPSBaud = 9600; TinyGPSPlus gps; int temp = 0, i; SoftwareSerial ss(RXPin, TXPin); String stringVal = ""; void setup() { Serial.begin(9600); Wire.begin ( ); Serial.println ( "Sensor bekleniyor" ); sensor.initialize ( ); Serial.println (sensor.testConnection ( ) ? "Baglanti basarili :)" : "Baglanti basarisiz :("); delay (1000); pinMode(button1, INPUT_PULLUP); Serial.println ( "Sim ile haberlesme basliyor" ); sim800l.begin(9600); pinMode(button2, INPUT_PULLUP); delay(1000); //Serial.println ( "Sinyal olculuyor deger max 31" );
sim800l.println("AT+CSQ"); updateSerial(); //Serial.println ( "Sim bilgileri okunuyor" ); sim800l.println("AT+CCID"); updateSerial(); sim800l.println("AT+CREG?"); updateSerial(); sim800l.println("AT+CBC"); updateSerial(); sim800l.println("AT+GSV"); updateSerial(); sim800l.println("AT+GSV"); updateSerial(); Serial.begin(9600); ss.begin(GPSBaud); delay(2000); gsm_init(); Serial.println("AT+CNMI=2,2,0,0,0"); delay(2000); delay(2000); temp = 0;
} void loop() { serialEvent(); while (temp) { while (ss.available() > 0) { gps.encode(ss.read()); if (gps.location.isUpdated()) { temp = 0; digitalWrite(13, HIGH); tracking(); } if (!temp) break; } } digitalWrite(13, LOW); } void serialEvent() { while (Serial.available() > 0) { if (Serial.find("konum bul")) { temp = 1; break; } else { temp = 0; } } } void gsm_init() { boolean at_flag = 1; while (at_flag) { Serial.println("AT"); delay(1); while (Serial.available() > 0) { if (Serial.find("OK")) at_flag = 0; } delay(1000); } delay(1000); boolean echo_flag = 1; while (echo_flag) { Serial.println("ATE0"); while (Serial.available() > 0) { if (Serial.find("OK")) echo_flag = 0; } delay(1000); } delay(1000); boolean net_flag = 1; while (net_flag) { Serial.println("AT+CPIN?"); while (Serial.available() > 0) { if (Serial.find("+CPIN: hazır")) net_flag = 0; } delay(1000); } } void init_sms() { Serial.println("AT+CMGF=1"); delay(400); Serial.println("AT+CMGS=\"numaranı buraya yaz\""); delay(400); } void send_data(String message) { Serial.print(message); delay(200); } void send_sms() { Serial.write(26); } void tracking() { init_sms(); send_data("konum gönderiliyor:"); Serial.println(" "); send_data("konumuz:"); Serial.println(" "); Serial.print("enlem: "); Serial.print(gps.location.lat(), 6); Serial.print("\n boylam: "); Serial.println(gps.location.lng(), 6); Serial.print("https://www.google.com/maps/@"); Serial.print(gps.location.lat(), 6); Serial.print(','); Serial.print(gps.location.lng(), 6); Serial.print(",14z"); send_sms(); delay(2000); } bu da hata kodu Arduino:1.8.15 (Windows Store 1.8.49.0) (Windows 10), Kart:"Arduino Uno" C:\Users\doruk\Desktop\Masaüstü\denmeme\denmeme.ino: In function 'void setup()': denmeme:48:5: error: 'updateSerial' was not declared in this scope C:\Users\doruk\Desktop\Masaüstü\denmeme\denmeme.ino:48:5: note: suggested alternative: 'HardwareSerial' C:\Users\doruk\Desktop\Masaüstü\denmeme\denmeme.ino: In function 'void serialEvent()': C:\Users\doruk\Desktop\Masaüstü\denmeme\denmeme.ino:98:32: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] C:\Users\doruk\Desktop\Masaüstü\denmeme\denmeme.ino: In function 'void gsm_init()': C:\Users\doruk\Desktop\Masaüstü\denmeme\denmeme.ino:118:27: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] C:\Users\doruk\Desktop\Masaüstü\denmeme\denmeme.ino:131:27: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] C:\Users\doruk\Desktop\Masaüstü\denmeme\denmeme.ino:143:38: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] exit status 1 'updateSerial' was not declared in this scope This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences. |
Bildirim