user77761: 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?

user70020: attachInterrupt expects a simple pointer to function taking no arguments and returning nothing (void).
So, really there's no way to directly do what you're talking about.  There's no currying ability builtin.  You can define your own functions like
void proxy_changedirection_1() {
    changedirection(1);
}

And then attachInterrupt specifying proxy_changedirection_1, or you can use a lambda with no captures for the same purpose:
attachInterrupt(
    digitalPinToInterrupt(stallsense1),
    [] () {
        changedirection(1);
    },
    RISING
);


77761: <p>I'm defining an attachinterrupt and I'm running into an error. The line in question is:</p>
<pre><code>void setup() {
   attachInterrupt(digitalPinToInterrupt(stallsense1), changedirection(1), RISING);
   attachInterrupt(digitalPinToInterrupt(stallsense2), changedirection(2), RISING);
}
</code></pre>
<p>and the error I'm getting is:</p>
<pre><code>error: invalid use of void expression
attachInterrupt(digitalPinToInterrupt(stallsense2), changedirection(2), RISING);
                                                                                ^
exit status 1
invalid use of void expression
</code></pre>
<p>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?</p>
 70020: <p><code>attachInterrupt</code> expects a simple pointer to function taking no arguments and returning nothing (void).</p>
<p>So, really there's no way to directly do what you're talking about.  There's no currying ability builtin.  You can define your own functions like</p>
<pre class="lang-cpp prettyprint-override"><code>void proxy_changedirection_1() {
    changedirection(1);
}
</code></pre>
<p>And then <code>attachInterrupt</code> specifying <code>proxy_changedirection_1</code>, or you can use a lambda with no captures for the same purpose:</p>
<pre class="lang-cpp prettyprint-override"><code>attachInterrupt(
    digitalPinToInterrupt(stallsense1),
    [] () {
        changedirection(1);
    },
    RISING
);
</code></pre>
