• I had run the blockly like code structure successfully... without going out of memory to turn the LED1 on (instead of sound on C9) and then turning off based on the BTN1 (instead of C6) event and with variables for C7 and A8 that I controlled in the console to emulate your hardware setup. It is quite challenging to replicate larger blockly on visual basis only. Also, at the time of the post, I did not know how I could get the generated / uploaded Javascript code to be shown. Now I know (as you can read in post):

    To show blockly generated Javascript code, upload the blockly code to Espruino board, then click into the console pane (left-hand pane), and press the up-arrow button TWICE.

    To be precise, it shows only the last uploaded blockly block. If you have more than one blockly block - for example two functions (* to functionName) - press the up button again to show the other block, and so on...

    This will show the generated and uploaded code... in a bit ugly format (and not with all semicolons the WebIDE wants it, but nevertheless correct (optimized) javascript). By copying the code shown from the console (just mark the code with the mouse includes an auto-copy on marking-end-event), then pasting it into the javascript source code editor (right hand pane), and doing some editing, you get a nice head start though for moving on with 'real' coding...

    Yes, code form source is easier to understand and to build... of course, this is mostly true only for users that did already some (javascript) coding/programming. But you get quickly there and like the code more than the nice looking, instructional blockly presentation (btw, I'm not aware of any function in the WebIDE that would create blockly out of source code).

    Would the device work better with the actual Javascript code?

    No, not really, because it is javascript after all that is uploaded... Espruiono has not knowledge whether the code came to be by direct coding or by generating from blockly. Too bad that I did not save the blockly code or I just cannot find it quickly and look at the geneated code... but I will see what I can do to find the issue you are running into. Using coding with the same logic, you should though just be fine.

    Thanks for sharing what you actually are doing. I may understand a bit better what you want to achieve.


Avatar for allObjects @allObjects started