user11181: I've created the following function:
void runMotor(int _dir, int _step, int wait){
  digitalWrite(_dir, HIGH);
  for (int x = 0; x < 3200; x++) {
    digitalWrite(_step, HIGH);
    delayMicroseconds(wait);
    digitalWrite(_step, LOW);
    delayMicroseconds(wait);
  }

In the first line inside the function I used the value HIGH as a fixed value. I would like to know if there's a way to pass the values HIGH and LOW as a parameter in this function. Is it possible?
Or should I just create a new function to rotate my step motor to the other side?

user10794: digitalWrite expects the pin and value to be uint8_t type. So you can certainly pass LOW or HIGH to functions.
For example:
void runMotor(int _dir, int _step, int wait, uint8_t value){
  digitalWrite(_dir, value);


11181: <p>I've created the following function:</p>

<pre><code>void runMotor(int _dir, int _step, int wait){
  digitalWrite(_dir, HIGH);
  for (int x = 0; x &lt; 3200; x++) {
    digitalWrite(_step, HIGH);
    delayMicroseconds(wait);
    digitalWrite(_step, LOW);
    delayMicroseconds(wait);
  }
</code></pre>

<p>In the first line inside the function I used the value <code>HIGH</code> as a fixed value. I would like to know if there's a way to pass the values <code>HIGH</code> and <code>LOW</code> as a parameter in this function. Is it possible?</p>

<p>Or should I just create a new function to rotate my step motor to the other side?</p>
 10794: <p><code>digitalWrite</code> expects the pin and value to be <code>uint8_t</code> type. So you can certainly pass LOW or HIGH to functions.</p>

<p>For example:</p>

<pre class="lang-c++ prettyprint-override"><code>void runMotor(int _dir, int _step, int wait, uint8_t value){
  digitalWrite(_dir, value);
</code></pre>
