Hello all,
my first post ... after years ...i solved almost my question in the past but I really cannot solve the issue this time.
Maybe it is an HW related issue and I'm ordering a new board but I try to enter the post because I see just another commenting similar issue.
Here below a very simple sketch.
#define FW_VER 0.0
unsigned long nowTime = millis();
unsigned long cnt = 0;
void setup()
{
Serial.begin(115200);
delay(500);
//sysTime = millis();
Serial.println(F("\r\n*********************************************"));
Serial.print(F("* test"));
Serial.print((String)FW_VER);
Serial.println(F(" by I.B. *"));
Serial.println(F("*********************************************"));
}
void loop()
{
char outBuf[100];
if (Serial.available() > 0)
{
String command = Serial.readStringUntil('\n');
if(command.length()>3)
{
Serial.println(F("Ok!"));
}
else
Serial.println(F("short!"));
}
if((unsigned long)(millis() - nowTime) >=200)
{
nowTime = millis();
cnt++;
sprintf(outBuf,"Count=%010lu;Time=%010lu;\r\n", cnt, nowTime);
Serial.print(outBuf);
}
}
With this sketch randomly i have missing char in the transferred string over the USB
It is completely random without any relation with for example the other print when I type something.
I guess it is a problem of the CH340 but not having yet a second board I cannot judge.
Any comment from you experts?
Thanks in advance!
P.S.: I hope I posted in the right category!