I have used the Nano and now trying to use the same code on a Nano Every. I've read about the differences a bit. I read one difference is the Tx/Rx lines are Serial1 on the Every and Serial on the Nano.
I have a little cheap project using PIR sensor and buzzers to keep pack rats out of areas of my yard, shed, under the hood of cars parked outside, etc. I wanted to be able to walk up and plug into the tx/rx pins with a laptop and see status, how many times triggered, etc. I had to use just tx/rx so when plugging in it wouldn't trigger a reset and I loose everything. I'm using a USB to serial converter for this. This works fine on the Nano
(I'm still learning and have not yet spent the time to get wifi/IOT boards working which would eliminate this need, I know. Also, trying to keep these things cheap, run them on the car battery so like the low cost of simple Nano Every).
I can get the Nano Every Tx/Rx lines to output by a Serial1.print cmd instead of a Serial print.
However, I also need the serial print commands for debug, working on the IDE.
So, now I have to duplicate every print command to Serial and Serial1 command in the sketch if I want it to be visible on IDE and on the serial output (I'm using Putty for serial Tx/Rx output).
Googling I see discussions of using stream classes to make this easier somehow but it's a bit above my skills now. I was wondering if there is an easy way to make print statements go to both places which I've missed. If not, the best link/reference on how to do so I can read/learn.
I have used sprintf to create a buffer and print that in some cases. Using this everywhere would make it a bit easier as I'd create the print output buffer once and then just print it twice to serial and serial1. But I read somewhere sprintf wasn't recommended for some reason and I had a learning experience with it overflowing buffer and clobbering something that took me forever to figure out - so a bit hesitant to keep using it. If no worries/concerns with sprintf - perhaps this is easiest/quickest for me at this point. Thoughts on this appreciated.
Any advice, pointing to direction for learning would be also appreciated.