title: Arduino character array serial
body: <p>I'm having a little bit of trouble with this bit of code here for my Arduino.</p>
  <p>Basically, I'm trying to send in a series of characters, turn it into an character array, and use that to run the rest of the program. I'm close because I know everything is working perfectly internally, but when I boot from the serial port, the message isn't getting in.</p>
  <p>I assume that at this point it probably is how I am constructing the array... or some oddity. It is probably just a simple error in how I put the code together, but I'm completely struck. (I was previously using a string, but because of how the Arduino works with them, it pretty much makes using them for memory purposes impossible.)</p>
  <p>I'm using a Java program (<a href="http://www.ardulink.org/what-is/" rel="nofollow noreferrer">Ardulink</a>) to send the information into the program with a customized version I've edited. So simply put, the input has to be a series of characters, and I need it stored in an array.</p>
  <pre><code>void serialEvent()
  {
    int arrayPostion = 0;
    int i;
    int maxArraySize = 20;
    char CharArrayInLocal[20];
    while (Serial.available() &amp;&amp; !stringComplete)
    {
      char inChar = (char)Serial.read();
      CharArrayInLocal[arrayPostion] = inChar;
      arrayPostion++;
      if (inChar == '\n')
      {
        stringComplete = true;
      }
    }
    for (int i = 0; i&lt;=19; i++)
    {
      CharArrayIn[i] = CharArrayInLocal[i];
    }
  }
  </code></pre>