Are you using the optotriac for AC or DC? Triacs don't turn off on DC, they only turn off when the voltage they're switching goes to 0. It makes them great for switching AC because there's very little noise though.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Are you using the optotriac for AC or DC? Triacs don't turn off on DC, they only turn off when the voltage they're switching goes to 0. It makes them great for switching AC because there's very little noise though.