Error: return-statement with a value

Hello to everyone I keep getting this error >:( >:( >:( , I followed the guide and i found that my code should be correct. Do you have any pointers?

Although my function type is int it keeps saying that i use void.

I try to read the analog input from a current sensor this is acs712.h

int current(int choose);

int current(int choose){
    int mVperAmp = 0; // use 185 for 5A Module, 100 for 20A Module and 66 for 30A Module
    int RawValue= 0;
    int ACSoffset = 1658; 
    double Voltage = 0;
    int Amps;
  if (choose == 16){
    mVperAmp = 100; // use 100 for 20A Module and 66 for 30A Module
    RawValue = analogRead(current16A);
    Voltage = (RawValue / 4096.0) * 3300; // Gets you mV
    Amps = ((Voltage - ACSoffset) / mVperAmp);
    return Amps;
  }
  else if (choose == 5){
    mVperAmp = 185; // use 100 for 20A Module and 66 for 30A Module
    RawValue = analogRead(current5A);
    Voltage = (RawValue / 4096.0) * 3300; // Gets you mV
    Amps = ((Voltage - ACSoffset) / mVperAmp);
    return Amps;
  }
}

while from the main page i call the result like this

#include "pinout.h"
#include "acs712.h"

void setup() {
  // put your setup code here, to run once:
 Serial.begin(9600);
}

void loop(){
 Amps = current(5);
 Serial.print(Amps);
}

the error i get on the compiler

sketch\acs712.h: In function 'void current(int)':

sketch\acs712.h:16:12: error: return-statement with a value, in function returning 'void' [-fpermissive]

     return Amps;

            ^

sketch\acs712.h:23:12: error: return-statement with a value, in function returning 'void' [-fpermissive]

     return Amps;

            ^

exit status 1

**keep in mind i use an stm32 "blue pill" board with arduino bootloader and using arduino IDE

I am far from an expert on linking files, but I think you put the function in a c file with the same name as an h file and put the function declaration in the h file only. The way you have it, with two functions with the same declaration in a single file, the first one is not returning anything, and the second one is ignored. alternatively, copy the function (second one) from the h file and place it above or below the setup() and loop() functions in your main code page.

What is in pinout.h?

NOTE: You should put a 'return' statement at the end of current() just in case the value passed is not 16 or 5.

When I put this in pinout.h:

const byte current16A = A0;
const byte current5A = A1;

int Amps;

The sketch compiles without errors and only one warning:

In file included from /Users/john/Documents/Arduino/sketch_jul13a/sketch_jul13a.ino:3:0:
sketch/acs712.h: In function 'int current(int)':
sketch/acs712.h:23:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
Sketch uses 2856 bytes (8%) of program storage space. Maximum is 32256 bytes.
Global variables use 184 bytes (8%) of dynamic memory, leaving 1864 bytes for local variables. Maximum is 2048 bytes.