A minor confusion in digitalWrite command
Every other value than 0 or LOW will result in setting the pin to HIGH. In the following I explain why:

The function digitalWrite() can be seen in the file hardware/arduino/avr/cores/arduino/wiring_digital.c. The important lines here are:

if (val == LOW) {
    *out &amp;= ~bit;
} else {
    *out |= bit;
}


As you can see, it checks, if the given value (from the parameter) is equal to LOW and if so will set the corresponding pin to 0. In every other case it will set the pin to 1. The definition of LOW can be found in arduino/hardware/arduino/avr/cores/arduino/Arduino.h:

#define HIGH 0x1
#define LOW  0x0


So the code checks, if the value is equal to 0 and sets the pin also to 0. Every other value will result in a 1 (meaning HIGH). Also have a look at the definition of digitalWrite():

void digitalWrite(uint8_t pin, uint8_t val)


The value is an unsigned type, so every signed type will be casted to an unsigned type. A negative number would result in a positive number inside the function.