Does your sketch not call any functions such as pinMode(), Serial.print(). digitalRead(), digitalWrite() etc, etc ? They are built in functions
You can write your own functions, such as useXnY() and call those as illustrated by @DaveX and I
As to the source of the code, do you mean the syntax of how to call a function ? That is standard C/C++ functionality so do not expect it to be in the Arduino Reference which concentrates on Arduino specific topics
I have to say that the more this thread goes on I am more suspicious of your reluctance to provide information, post your code and your apparently naïve questions.
It was just a thought. You are right of course. “you want to do something specific with y when x is a certain value, and what you do with y changes based on the value of x.”
The coding ‘useXnY’ and ‘readXnY’ looks like the answer. I need to know more about this code before I can use it properly. Do you know where I can find this code? Examples of its use, like they give for coding in Arduino help, would be very useful.
I believe you are right now. Probably it looked too easy so that I started to look for something more complicated.
on one line in the sketch the value of x is derived from an equation. on the next line the value of y is derived from a different equation. their values are derived at the same time as shown by a real time clock. so every time there is an x value there will be a corresponding y value. they are linked together permanently. when one action is done with the x value, at the same time an action will be done with the y value. the x value moves a servo motor. the y value moves a different servo motor. a robotics application.
I have been asked to give the equations. They would be meaningless to the forum unless i explained what they were for and also how they were derived. This topic would then go on for the next 6 months and nobody wants that.
I saw this looking back. useXnY and readXnY are just function names that @DaveX made up to illustrate how code might be written to use or receive two values passed to it.
In the code where you see those two functions they are serving as stubs.
A stub is a function that has the expected signature (i.e. name and accepted arguments), but an incomplete implementation
waiting and ready for you to pour your heart into what to actually do to use, or read, x and y.