Hi, I'm not new to Arduino but haven't used it for many years so pretty rusty. Trying to port a project to the IDE environment and have a fundamental problem.
Serial.write works just fine inside loop() but not in a function external to the main INO file.
Strange. With the 1 second delay between each character written to the console you are not exceeding the modest capabilities of 9600 baud. I'd have expected a slow delivery of this sequence "XYXYXYXY...." to the console based on your original code and assuming a conventional hardware setup. What is the file type of the external code ?
That's what I though until 2 minutes after posting
But the last thing quub_loop() does before returning is Serial.write("X"), and the FIRST thing loop() does on getting control back is Serial.write("Y").
These two calls would be just microseconds apart.
Now that said I would have thought that there was a buffer to handle such things, but it seems not.
OK. When I get a chance later on today I'll attempt to duplicate your findings ins Wokwi.com. Would a Uno be a realistic representation of your hardware and are you using a reasonably fresh version of the IDE ?
Thanks, it's been a while since I posted here eh? I did recognize your handle on another post the other day and thought, wow he's still here.
I've been out of the game for a few years but getting back into it now with a new design...well a rehash of a 10-year-old design So I might get active again, most of the board models are new to me now but I'm working with the Pi Pico which is a nice piece of kit.
I'm setting up a new lab but am also building a house so time is limited probably until next year.