Is it possible to pass HIGH and LOW values as parameter in a function? I've created the following function:

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);
  }


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?
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);