How do I see the JavaScript that the Blockly Code produces? I thought that toggling to the JavaScript view would update the code, but it does not.
Is there a delay() or sleep() function? I just want to move a servo, wait a second (for it to move), then move it again. I thought setTimeout() would work, but it does not. This line of code works:
setTimeout("analogWrite(C6, 2.0 / 50.0, {freq:20});",4000);
But if I put this line after it, the code no longer works (properly):
setTimeout("analogWrite(C6, 1.0 / 50.0, {freq:20});",4000);
I tried playing with clearTimeout() to no avail.
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.
Thanks Gordon, that worked :)
I have two more questions though:
How do I see the JavaScript that the Blockly Code produces? I thought that toggling to the JavaScript view would update the code, but it does not.
Is there a delay() or sleep() function? I just want to move a servo, wait a second (for it to move), then move it again. I thought setTimeout() would work, but it does not. This line of code works:
setTimeout("analogWrite(C6, 2.0 / 50.0, {freq:20});",4000);
But if I put this line after it, the code no longer works (properly):
setTimeout("analogWrite(C6, 1.0 / 50.0, {freq:20});",4000);
I tried playing with clearTimeout() to no avail.
Thanks,
Rehman