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 which takes either a 1 or 2 as input, depending on which interrupt was triggered. I believe the issue is that when I've written changedirection(1) I'm calling it. I want to simply tell attachinterrupt to call the function changedirection with an input of either 1 or 2. How would I do this?