That is probably why. The input of the opto-isolator is the anode of a led. The cathode is connected to ground. You must set the current when the state of the pin is HIGH. May I suggest a 470-500 ohm resistor between the Arduino pin and the opto-isolator input. Hopefully, you have not torched the output on that pin.
You write to the control register, and read from the pin. At least that is the way I remember it. ![]()