No. I made up that function name and insides to stand in for the complicated stuff that you said you already know how to “download” because we do not have a clue about whatever makes x & y.
Did you read this:
And especially the tutorial at
CHAPTER 1 - INTRODUCTION When you are new to programming and the Arduino system it can be very tempting to use one of the example sketches and make changes or add bits onto it to meet your needs. If what you are doing is even a little bit complex this approach will quickly turn into an incomprehensible mess. There are plenty of questions in the Forum that provide vivid examples of this. Adding bits and pieces will probably seem fine as long as you have the correct image of the code in your he…
It does an excellent job of explaining how to build an easy to understand and maintain program by using functions like readXnY() and useXnY() to organize and communicate a thought process behind the programming.
I’m glad you see a way forward because it still isn’t clear to the rest of the world what you need.