sensor calibration code

Hi, For a project I'm working on I want to scan a surface (let's say a square of 100X100 mm) and export the data of the x,y and z coordinates and the output of the sensor (2 channels) to txt or excel file. For that purpose I have mounted the sensor instead of the extruder on Prusa I3 Printer (with Ramps 1.4 + Arduino mega 2560). Is there a code (or something similar) for generating the x,y and z coordinates (for the 100X100 square) and exporting the output from the sensor VS the coordinates position (for example: X=10 Y=10 Z=5 CHANNEL1=2 CHANNEL2=0)?

Thank you,

You must tell the 3D printer where to position the head, so you already know the x,y,z coordinates.

That's right, but i want to program the pattern myself (not with g code but straight to the arduino with step function) and i want the final input to include both the coordinates and the output from the sensor and I wonder if a similar code already exist.