-
I am looking to have simultaneous execution of tasks and I am wondering if anyone has considered implementing web workers?
Specifically, I need to monitor a pin and activate a motor while sending data to a sound board over serial. However, I want the motor to stop when the pin is no longer triggered but have the sound continue.
Additionally, I would like to be able to asynchronously send data over wifi without interrupting the previous two tasks. I can see how the first one might be combined into one task with careful control of looping, but the second task will probably not be possible in the same cycle.If I had something like a web worker, I could control the three tasks independently and trigger them when the appropriate event is detected.
As a less cool but possibly faster hack, you could take the remote apart and solder wires to the button connection points and Espruino pins. Then it should just be a simple matter of sending a '1' to the pin to activate that function. Of course, doing it this way you don't learn as much about the underlying remote control operation.