digitalWrite(Pin, LOW); digitalWrite(Pin, 0); what's the difference?

can someone let me know what is the difference between

digitalWrite(Pin, LOW); and digitalWrite(Pin, 0)

at the moment i am using this code to touch a pin down to ground as it is a soundboard that uses pins touched to ground to activate a sound

  int HelloPin = 42;
  pinMode(HelloPin, OUTPUT);
  digitalWrite(HelloPin, 1);

then

  digitalWrite(HelloPin, 0);

and i want to know is there a difference between the 2 options

None. LOW is a compiler define that equals 0. The only difference is which is more readable for you.

oh ok i asked a question how to add the triggers and someone said use the 1 instead of low i thought it was different to LOW

so does this actually touch the pin to ground then?

i thought it was different to LOW

One IS different from LOW. LOW is zero. HIGH is one.

PaulS: One IS different from LOW. LOW is zero. HIGH is one.

come on its obvious that was a typo from my first post

i ment i tought 0 and low was difernt

come on its obvious that was a typo from my first post

How would we know that your first post did not have a typo in it ? :)

Anyway

digitalWrite(Pin, LOW);

and

digitalWrite(Pin, 0)

do the same thing, ie take the pin to ground, or very close to it, because, as has been said, LOW is defined as 0 in the Arduino environment.

LOW/false/0 all the same thing, as are HIGH/true/1. In a boolean context any non-zero value is treated as true...

For instance

  if (digitalRead (pin) == HIGH)
  ...

happens to be tautological, you just need

  if (digitalRead (pin))
  ...

Sometimes you don't want the code to have the knowledge of whether a pin is active-high or active-low bound into it, in which case use some #defines perhaps:

  if (digitalRead (BUTTON) == PRESSED)
  ...

Then all the details can be in a .h file. The same can be done for outputs so that you don't need to use LOW or HIGH in the bulk of the code at all, making it more re-usable and generic (always a good thing).

MarkT: LOW/false/0 all the same thing, as are HIGH/true/1. In a boolean context any non-zero value is treated as true...

For instance

  if (digitalRead (pin) == HIGH)
  ...

happens to be tautological, you just need

  if (digitalRead (pin))
  ...

Likewise:

 if (digitalRead (pin) == LOW)
 ...

is the same as:

 if (!digitalRead (pin))
 ...