Write to custom (or arduino based) device in live mode



I am putting this little code in

onRun(args, app, device, block) => {
device.writeRaw([0xc0, 0x01]);

in an Arduino based device (also tried in an Arduino based extension)
to use it in live mode. No data is sending, Is it working?

Thanks regards.


Could you give more info and screenshots, perhaps?


Simple new device with a block. Conection is successful, but nothing is sending by serialport.
Thanks, regards


Update: It is working in desktop app but is not working in preview (from extension builder, using mLink)


I’ve had problems with the mBlock online preview not running code properly. You can disable online mBlock support for your extension (it won’t show up on ide.mblock.cc) or you can publish it and see if it works after publishing.