Hi, I'm afraid proper multitasking isn't going to happen - there's not enough memory for two execution stacks.
The way Espruino works, you execute code on events. So when a pin changes state it executes code which starts or stops your motor. The WiFi works the same way so you'll find that if you write your code in an Espruino-friendly way (eg. not while (true) ...) everything will 'just work'.
Having said that I'm not sure you'll have much luck streaming sound data I'm afraid (multitasking or not) because of general RAM/speed issues in Espruino.
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.
Hi, I'm afraid proper multitasking isn't going to happen - there's not enough memory for two execution stacks.
The way Espruino works, you execute code on events. So when a pin changes state it executes code which starts or stops your motor. The WiFi works the same way so you'll find that if you write your code in an Espruino-friendly way (eg. not
while (true) ...
) everything will 'just work'.Having said that I'm not sure you'll have much luck streaming sound data I'm afraid (multitasking or not) because of general RAM/speed issues in Espruino.