Hello everyone,
I'd like to modularize my program.
Therefore I need a function called readAnalogValue();
Out of my void loop() function I want to open the readAnalogValue function with input parameter of the desired analog pin.
E.g.
void loop()
{
int actualFeedback = readAnalogValue (A0);
}
int readAnalogValue (int SensorNumber)
{
int sensorValue = analogRead(SensorNumber);
return sensorValue;
I actually have no arduino here to test the function.
I really dont know if the input parameter of the function readAnalogValue works well with an integer.
But the compiler said it'll be ok.