Hi guys ! I'm working right now with my project that the text message

fastled-support
gplus
(jester salivio) #1

Hi guys ! I’m working right now with my project that the text message from GSM module will display on RGB LED Strip , I have conditions using text message ; View AllMessage , Delete AllMessage , Delete Message # ,Display AllMessage , if the textmessage is not the conditions above , it will automatically stored in a array (that the message that will display on RGB LED Strip)

But when i started to text Display AllMessage( display all message that saved in array) and text again some message it only read 12 characters in my text . Are my arduino is too busy to display message in RGB Led strip so that when i text again it only accept only 12 characters ? help me guys the code is below . And i uploaded pictures , i texted 3 messages that will display on array , " The Legend of Avatar " and etc . then I texted Display Allmessage ( to display in RGB ) the 4th text is also " The Legend of Avatar " but it in serial monitor it cut on 12 characters only

if(mySerial.available()>0){
Message = mySerial.readString();
delay(500);

Message=Message.substring(Message.indexOf("+CMT"));
Message=Message.substring(Message.indexOf("\n"));
Message.replace("\n","");
Serial.println(Message);

if(Message.indexOf(“View Message”)>=0){

 mySerial.println("AT+CMGS=\"+639290584072\"\r"); // Replace x with mobile number
 delay(1000);
   for(int i=0; i <5; i++){
 mySerial.println("Text: "+ text[i]);// The SMS text you want to send
 delay(100);
   }
 mySerial.println((char)26);// ASCII code of CTRL+Z
  delay(1000);

}
else if(Message.indexOf(“Delete AllText”)>=0){
for(int i = 0; i < 5; i++){
text[i] = “”;
}
}

//Delete Message
else if (Message.substring(0, 11) == “Delete Text”) {
Message.remove(0,11);
text[Message.toInt() - 1] = “”;
Serial.println(Message);
}

else if(Message.indexOf(“Display AllMessage”)>=0){
j = 1;

}

else {
if(Message == “”){
Serial.println("");
}
else{
text[i] = Message;
Serial.print(“Message Stored!”);
Serial.println(i);
i++;
}
}
}

if( j == 1){
for(int i=0; i <5; i++){
matrix->fillScreen(0);
matrix->setCursor(1, 1);
matrix->setTextColor(colors[i]);
matrix->print(text[i]);

matrix->show();
delay(1000);
}
if(i == 4){
i = 0;
}
}

(Yves BAZIN) #2

@jester_salivio can we see how you did define the variable ‘text’

(jester salivio) #3

@Yves_BAZIN String text[4];

(Yves BAZIN) #4

@jester_salivio hello
It should be text[5] and not 4 because you go from i=0 to I=4 which is 5 values
Then I think the
string text[5]; is not allocating the memory as you think.

(jester salivio) #5

But String array also start at 0 right ? Text[0] to text[4] . Thanks bro I figured out the problem . I add DISPLAY OFF function , j =0 ; so that the text will stop displaying and when I texted again in GSM module it can accept more than 12 characters again . maybe because arduino is too busy displaying text ing rgb right ? But I’m not sure haha :sweat_smile: . Somehow I solved it thanks bro for noticing my post :slight_smile:

(Yves BAZIN) #6

@jester_salivio when you declare an array you declare its size
So
string g[x] is an array of size x
values are from g[0] to g[x-1].
This as nothing to do with displaying Rgb. I am pretty sure you are writing in ‘wrong part’ of memory and if you expand your code it might fail.
Il will send you the correct way I think to do so

(jester salivio) #7

@Yves_BAZIN okay bro thank you :slight_smile: