jonidohc16v
Member
Hi everyone!
I'm trying to send and read a text file from PC to the teensy. I already created a software on the PC with VS and I managed to send the file to the teensy.
The file is like this:
aaaaaaaaaaaaaaaaa
ddddddddddddddddd
aaaaaaaaaaaaaaaaa
With this piece of code I managed to print all the lines from the file.
But when I try in the loop to show one line at a time, I can't make it show one line at a time, it only shows the last line all the time.
I'm new in coding, so if anyone could help me it would be very nice.
Thanks,
Jonathan
I'm trying to send and read a text file from PC to the teensy. I already created a software on the PC with VS and I managed to send the file to the teensy.
The file is like this:
aaaaaaaaaaaaaaaaa
ddddddddddddddddd
aaaaaaaaaaaaaaaaa
Code:
void scenario ()
{
line[16];
for (int y = scen_min; y < scen_max; y++)
{
if(buffer[y] != ' ')
{
line[y] = buffer[y];
}
}
/*for(int y = scen_min; y < scen_max; y++)
{
TIME += line[y];
}
Serial.print(TIME);*/
Serial.print(line);
/*Serial2.println("SCENOK");
Serial.println("SCENOK");*/
}
With this piece of code I managed to print all the lines from the file.
But when I try in the loop to show one line at a time, I can't make it show one line at a time, it only shows the last line all the time.
I'm new in coding, so if anyone could help me it would be very nice.
Thanks,
Jonathan