shailav619

Members
  • Content count

    3
  • Joined

  • Last visited

About shailav619

  • Rank
    Noob Class

Profile Information

  • Interests
    Microcontrollers
  1. Hello, I am using msp430g2553 mcu and I interfaced that mcu with gsm sim900 successfully. Now I am facing some strange behavior in the code. When I write the loop as follows: void loop() { String buffer = readSIM900A(); String msgOn = buffer; String number1 = "8320389582"; //problem String number2 = "9106555707"; //problem String number3 = "9979933498"; //problem if (buffer.startsWith("\r\n+CMT: ")) { Serial.println(buffer); buffer.remove(0,12); buffer.remove(10); Serial.println(buffer); msgOn.remove(0,51); msgOn.remove(3); Serial.println(msgOn); if(((buffer==number1)||(buffer==number2)||(buffer==number3))&&((msgOn=="On")||(msgOn=="ON")||(msgOn=="on"))) { digitalWrite(led, HIGH); } } delay(100); } In the lines above commented with "problem": -> When I write String number1 = "8320389582"; //problem like this and when I use this for toggling led like this if(((buffer==number1)||(buffer==number2)||(buffer==number3))&&((msgOn=="On")||(msgOn=="ON")||(msgOn=="on"))) { digitalWrite(led, HIGH); } This doesnt work but instead when I use the code like if(((buffer=="+91963xxxx")||(buffer=="+91963XXXX")||(buffer=="+918753XXX"))&&((msgOn=="On")||(msgOn=="ON")||(msgOn=="on"))) { digitalWrite(led, HIGH); } This works and I can toggle the led. According to my understanding there is some compiler issue in this related to memory for local loop. Can anyone help me with this? I am attaching my code for reference. Thanks, Shailav prefinal.rar