Waiting for incoming strings

Posted on
  • Is there a graphical module in the Web IDE for waiting for string from a serial or console port?

  • I'm not sure I understand...

    You want to program something to run inside the IDE itself?

  • Sorry, looking for a block, something like GET string from CONSOLE

  • Ahh, I see what you mean.

    I'm afraid not... Someone asked about this a while back, and I posted some code that could be used - however you'd have to modify the Web IDE to add a block: http://forum.espruino.com/conversations/­1536/#comment26339

  • Take a look to the testing plugin for WebIDE.
    Is this something you need ?

  • My using the console as an example may have confused things. What I am trying to do is poll a sensor that returns a string on one of the serial ports of the discovery board. I would need to add blocks for serial and spi ports?

  • Hi - yes, you'd have to add blocks for the other peripherals. I'm afraid that could end up being quite a lot of work.

    Having said that, last week I added a special block (only on the GitHub version of the Web IDE at the moment) that lets you write arbitrary JavaScript. As long as you don't have spaces in your variable names, you can access graphical variables and functions from the JavaScript block.

  • I saw the comment 'Added 'code' block for blockly that'll let you execute your own block… ', could you give a brief example or how to get started with this?

  • Nevermind, worked it out. Cool stuff.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Waiting for incoming strings

Posted by Avatar for tobor @tobor