i need some help with codes please!!
how do i fix this?
char input [ 10 ];
int index;
// clears string
for ( index = 0; index < 10; ++index )
input[index] = '\0';
// incoming data equals to string
for ( index = 0; Serial.available() > 0; ++index )
{input[index] = Serial.read();}
char msg[ 11 ];
//print string
sprintf (msg, "%s Messages...",input );
Senario:
lets say that i kept sending value of “92” to arduino the every 5 sec.
and the rate of it arduino printing the message is every 15 second
on the second loop onwards what i get is “929292 message”
the problem is the rate of sending is impair to the rate of printing,
which is why im getting three “92” appearing on the message.
i know i can set it both to equal rate to avoid this problem. but is there any other way to adress this problem?
bitwise & it??i think im too stupid to change the code here :’(
also…please pardon my poor english