Hallo
i am new to C and the arduino
i have a question
i am bulding a vu meter
and i want to find the max and the min analog read from my microphone
so i write a "void"
void analog_calibration (int analoginput)
{
timecounter = millis();
timerunning = 0;
mini = 1030;
maxi = 0;
for (i=1; ((timerunning-timecounter) < calibrationtime); i++ )
{
value = analogRead(analoginput);
if (value < mini) mini = value;
if (value > maxi) maxi = value;
timerunning = millis();
}
}
so in my programm sometime i will write
analog_calibration(microphone);
how can i make return me the min and the max value?
to the main programm