TinyCircuits

Initial serial output is lost on new TinyZero

Initial serial output is lost on new TinyZero
« on: March 14, 2019, 01:33:07 PM »
Hi,
I just started to play with my new Tinyzero (with the accelerometer) board (impressive to get 3 or even 4 (with the RTC) boards in one now!!!).
After updating the Board manager (to get the tinyzero board option) I got my code to work. However, I noticed that with my code (written for the old t board system) as well as with the linked example code from Github (https://github.com/TinyCircuits/TinyCircuits-TinyZero-ASM2021/tree/master/examples/TinyZero_BMA250), I do never get the initial serial output from the setup section (i.e. all the initialisation messages e.g. "Initializing BMA..." in the example code). (I changed the Serial.print to SerialUSB.print, but still no success...).
The output from the main section of the code is then displayed OK.

Cheers!

PS: Could you also add an example on how to use the RTC on the new Tinyzero board? Does this work with the same libraries as for the previous RTC shield?
   

Re: Initial serial output is lost on new TinyZero
« Reply #1 on: March 18, 2019, 11:58:16 AM »
Hi, great to hear you like TinyZero as an upgrade to TinyDuino! One of the major differences in use is the SerialUSB virtual serial port and the fact that opening the serial monitor does not reset the processor like with TinyDuino. However, now you can test if the virtual serial port is open or not, so you can put something like this before any SerialUSB output in your setup:

while (!SerialUSB && millis() < 5000); //On TinyScreen+/TinyZero, this will wait until the Serial Monitor is opened or until 5 seconds has passed

Then you will get all output messages after that. We've updated some of our examples, but it's still a work in progress.

Thanks,
Ben