I appears that the OP has ignored all calls for information that could help us help him or her solve this and instead just started a new thread with the same code and none of the needed information.
The goal is to sense the current flowing through a buck converter using a current sensor, also to sense the voltage across it using a voltage sensor that I built. Keep in mind I'm dealing with high power. But everything has to be closed loop so that when I multiply the value of resistor by the reference current I have in the code: whatever voltage value I get as output should not change even if I change the power supply value. The only time voltage change is when I change resistor. I hope this is not COMPLICATED.
Here are my voltage and current closed loop control I designed on MATLAB Simulink. You can see the feedback loop at the buttom there with gain blocks.The device I'm using to measure output voltage is a multimeter. (Practically). The current sensor I'm using is the ACS712, voltage sensor I built myself to output about 3 volts and its ground connects to arduino ground. I hope this is what you asked for.
Right click one of the file names under your post and save the name (copy link address), then go to Modify the post. Click the add image icon (next to the chain) and use the saved name us the url and the pic will appear in the post.