Map function

can any body tell me where the map function is defined?

Currently it's defined in the core library of each hardware package. For example, for AVR boards, it's defined in cores/arduino/WMath.cpp:

long map(long x, long in_min, long in_max, long out_min, long out_max)
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;

If you need help locating that file on your computer, I can provide detailed instructions.

Arduino has been working on moving all this sort of non-architecture specific code into a separate repository, which all the core libraries can share:

But only a few of the core libraries are using ArduinoCore-API right now.

tq for the answer

You're welcome. I'm glad if I was able to be of assistance. Enjoy!

Remember this is open-source, you can simply grep for the stuff yourself in your copy of the sources.