Trigger an Arduino from a video card

At the beginning of your loop, you are doing an assignment

  if (trigger = 1)

which assigns the value 1 to trigger and then compares that to true/false which is always true so the code is executed. You need to use the comparison operator '=='

  if (trigger == 1)

Also, trigger needs to be declared volatile since it is used within an interrupt.

volatile int trigger = 0;

As a style note, never use lower case L as a variable, it looks just like the number 1 in the editor. Use more meaningful names.

Also, you shouldn't be doing your timing by for(), just check micros() and see how much time has elapsed. The arduino is plenty fast enough to keep within a millisecond. Note that micros() will only return values to a resolution of 4us.

It is also super slow to turn a number into a binary string to then compare it and set the LEDs. Just loop over the number and use the bitRead() function or, if you are comfortable with it, the shift '>>' and compare '&' operators.