How to add Code to your question?

@Rich555, your topic has been moved to a more suitable location on the forum.

Note that the IDE also has a function "copy for forum" that can replace steps 2 and 4 above if you want to post complete code.

PS
There is info here. https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966#posting-code. The whole topic is worth a read :wink: