String processing delimiter problem.

hello everyone thanks before, i wanna ask something. i want to separate text input from bluetooth connection. but i always go error message char to string.

i want use each word put inside array, so i can use that array later.

And what i do if i want put my code inside loop function?

#include <SoftwareSerial.h>
#define MAX_WORD_LENGTH 15

char messageArray[5][MAX_WORD_LENGTH + 1];
SoftwareSerial BT(10, 11);
String command = "";
char message[] = "";

void setup()
{
  BT.begin(9600);
  Serial.begin(9600);

  while (BT.available()) {
    delay(10);
    char c = BT.read();
    command += c;
  }

  if (command.length() > 0) {
    Serial.println(command);

    char message[] = {command};

    for (int i = 0; i < 5; i++) // you can 'reset' the array by writing a null to the first element of each
    {
      messageArray[i][0] = '\0';
    }

    sscanf(message, "%s %s %s %s %s", messageArray[0], messageArray[1], messageArray[2], messageArray[3], messageArray[4]);

    for (int i = 0; i < 5; i++)
    {
      Serial.println(messageArray[i]);
      delay(1000);
    }

  }

}

void loop()
{
  for (int i = 0; i < 5; i++) // you can 'reset' the array by writing a null to the first element of each
  {
    messageArray[i][0] = NULL;
  }
  command = "";
}

You have already a thread open on your question - why do you ask again about getting each word into an array? Double posting is a bad practice

Read Serial Input Basics

Oh my god i forget to close my before post im very sorry about that. im going to delete this.

ivejun:
Oh my god i forget to close my before post im very sorry about that. im going to delete this.

You cannot close a Thread on the Forum.

You can click Report to Moderator and ask for your two Threads on the same subject to be merged. Be sure to give the URL of the other thread to the moderator.

...R