The software has nothing to do with the optocoupler.
The optocoupler provides isolation of 2 electrical circuits and allows signals to pass between them by converting the signal to and then back from light.
I suggest you head back to google and further research the subject of your project and its various elements.
Optocouplers[
^]