I need some help writing a save() block in blockly. This code moves the servo on pin B14 to two positions 0.5 seconds apart then saves it to the microcontroller so the code executes next time I plug it in. This code works when I write it in the JavaScript window:
But as soon as I call the save() command from Blockly by changing line 18 to:
return move + move2 + saveCmd;
then the block does nothing. Meaning, the servo doesn't move, and there's no indication that anything was sent to the board. The frustrating part is that when I click on the command prompt side of the IDE and press up to see the commands sent, I see all three of the commands that I wanted to see:
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.
I need some help writing a save() block in blockly. This code moves the servo on pin B14 to two positions 0.5 seconds apart then saves it to the microcontroller so the code executes next time I plug it in. This code works when I write it in the JavaScript window:
Similarly, this code works to call the first two lines from a Blockly block, so I know I'm doing all of that correctly:
But as soon as I call the save() command from Blockly by changing line 18 to:
then the block does nothing. Meaning, the servo doesn't move, and there's no indication that anything was sent to the board. The frustrating part is that when I click on the command prompt side of the IDE and press up to see the commands sent, I see all three of the commands that I wanted to see:
Please help,
Rehman