I'm not understanding what's going on with my Uno. I have a very simple piece of code. no peripherals are connected. Just a bare genuine uno. I program in VisualMicro for Visual Studio.
void setup()
{
Serial.begin(115200);
char stringy[9] = { 0x7E, 0x00, 0x05, 0x08, 0x01, 0x44, 0x33, 0x04, 0x7B };
for (int i = 0; i < 9; i++) {
Serial.print(stringy[i]);
//delay(300);
}
Serial.println("");
Serial.print("done");
}
void loop()
{
while (1) { }
}
Without a delay of around 250msec or greater in the for loop, I don't get all the characters. In fact, without the delay, the code doesn't even finish executing. I only get the first character '~'. It doesn't seem to matter what my baud rate is.
This code runs fine without a delay on my Nano. What could possibly be the issue?
stty -F /dev/ttyACM0 raw 115200 && hd -n 15 /dev/ttyACM0
on the Linux console and got00000000 7e 00 05 08 01 44 33 04 7b 0d 0a 64 6f 6e 65 |~....D3.{..done|
(hd
is a hexdump utility).