I'm defining an attachinterrupt and I'm running into an error. The line in question is:
void setup() {
attachInterrupt(digitalPinToInterrupt(stallsense1), changedirection(1), RISING);
attachInterrupt(digitalPinToInterrupt(stallsense2), changedirection(2), RISING);
}
and the error I'm getting is:
error: invalid use of void expression
attachInterrupt(digitalPinToInterrupt(stallsense2), changedirection(2), RISING);
^
exit status 1
invalid use of void expression
The idea is I have one function changedirection and two possible inputs, either 1 or 2. I believe the issue is where I've called the function changedirection(1). I want to simply tell attachinterrupt to call the function changedirection with an input of either 1 or 2. How would I do this?