Hello i am new to this forums and I couldn't post a new post So I am asking my question here I wrote this code to get the 3 string values ( I will use strtod later) reading serially from matlab but I am not sure know why its not working. The output from the serial port is Arduino heard you saying I am not getting any values
here is the code
void setup ()
{
Serial.begin(9600);
} /////////////////////////////////////////////////////////////////////////////end of setup
////////////////////////////////////////////////////////////////////////////// here to process incoming serial data after a terminator received
void loop()
{
char input_line [50];
char datas[10];
unsigned int input_pos = 0;
if (Serial.available() >0){
Serial.print("Arduino heard you say: ");
while (Serial.available () > 0)
{
char inByte = Serial.read ();
while(inByte != '\n')
{
input_line[input_pos] = input_line[input_pos] + inByte;
if (inByte ==',')
input_pos++;
}
Serial.print(input_line[1]);
}
Serial.print(input_line[1]);
Serial.println();
Serial.print("I reached here: ");
Serial.print(input_line[0]);
Serial.println();
Serial.print(input_line[2]);
}
}
Moderator edit:
[code]
[/code]
tags added.