Hi everyone. I'm trying to make a function that will sweep a servo back and forth. I am going to need to add things like step size and the delay between steps. These wont be needed very often in my code. However there will be particular times when I would like to have control of the step size and time between steps.
It would be a pain in the neck if I had to write out each and every time what values I would like them to be. I would rather that if they were undefined then they would default to a value. for example if I had a code with the following inputs (obviously with the function after it)
void Scan(int ServoStep, int upperLim, int lowerLim, int delayTime)
Then I would like to be able to define just the first 1, 1-2, or 1-3 terms with the others defaulting to a pre set value.
I tried the following, but just got Scan was not declared in this scope when I tried to call it.
void Scan(int ServoStep = 1, int upperLim = 124, int lowerLim = 45, int delayTime = 10)
Is there any way of doing this in arduino? I'm more used to python, so I was expecting this to work.
Thanks, David.