Получение странного вывода, который я не вставил в код, используя Arduino GSM Shield - PullRequest
0 голосов
/ 22 апреля 2020

Итак, я играл с некоторыми датчиками, и до сих пор я делал с Arduino, когда слишком много газа (токси c воздух, дым и c), утечка воды или обнаружен пожар, Arduino отправляет текстовое сообщение на мой телефон, но я также получаю некоторый ненужный текст, который я не вставил в свой код. У меня также есть все необходимые библиотеки, не беспокойтесь

    int sensorThres = 400;

    char testNum[] {"myNumber"
};
  char eldur[] {"Eldur er i"
  };
  char vatn[] {"vatnskadi i kjallarinum"
  };
  char gass[] {"gass leki "
  };


     void setup() { 

    // start the serial console
    Serial.begin(9600);

    dht.begin();
    pinMode(LED,OUTPUT);
    pinMode(redLed, OUTPUT);
    pinMode(greenLed, OUTPUT);
    pinMode(buzzer, OUTPUT);
    pinMode(smokeA0, INPUT);

    while (!Serial) {
      ; // wait for serial port to connect. Needed for native USB port only
    }

    Serial.println("Ger klárt at senda sms");

    // connection state
    boolean notConnected = true;

    // Start GSM shield
    // If your SIM has PIN, pass it as a parameter of begin() in quotes
    while (notConnected) {
      if (gsmAccess.begin(PINNUMBER) == GSM_READY) {
        notConnected = false;
      } else {
        Serial.println("Einki samband");

      }
    }

    Serial.println("Klárt at senda");



  } 

void loop(){

     if (analogSensor > sensorThres)
  {
    digitalWrite(redLed, HIGH);
    digitalWrite(greenLed, LOW);
    tone(buzzer, 1000, 1000);
    sms.print(gass);
    sms.endSMS();

  }
  else
  {
    digitalWrite(redLed, LOW);
    digitalWrite(greenLed, HIGH);
    noTone(buzzer);
}

Это не весь код, но даже с этим я получаю ненужный текст, текст, который я получаю "AT + CMGS =" myNumberThatIvePutIntoTheCode "

...