Arduino binary LED 10 bit display
According to the official documentation, the second parameter of
digitalWrite() should be either HIGH or LOW. Thus, in order to be
compliant with the published API, you are supposed to write:
digitalWrite(12, sensorValue&amp;256 ? HIGH : LOW);

In practice, digitalWrite() interprets any non-zero value as HIGH.
However, its prototype is:
void digitalWrite(uint8_t pin, uint8_t val);

Both parameters have the type uint8_t, which means “8-bit unsigned
integer”. If you provide a value that doesn't fit in 8 bits, the
implicit cast to uint8_t will reduce it modulo 28. Thus,
both 256 and 512 become zero through the implicit cast.