I'm starting my first personal Arduino project. Though, I'm sorta stuck.. I'm trying to move Serial input into an array, but I can't figure out how. Here's what I have so far:
He has by far the best serial read code you will find on here and he posts it all the time. In fact, he will likely post it here in the morning.
Basically you are trying to read your bytes into an integer and you only have one.
So declare you incomingbyte as a char array like so:
char incomingbyte[20]; //Make sure this number is big enough to handle all the incoming data
int bufferindex = 0;
void loop()
{
while(Serial.available() > 0)
{
Serial.read(incomingbyte[bufferindex];
bufferindex ++;
}
}
That will populate your buffer with your incoming data but it is by no means complete cause now you have to do something with it. Also, you should include a start and end character of some sort so you know when to start reading data and when to stop.