# MiMic Javascript Editor

Return to top

Play
Stop
Save
Export
API Reference
Source code
<!DOCTYPE html> <html><head> <meta charset="UTF-8"> <script src="/rom/m/mbedJS.all-min.js"></script> <script type="text/javascript"> function start() { var mcu=new mbedJS.Mcu(location.host,{ onNew:function(){ var v=1; var pin=new mbedJS.DigitalOut(mcu,mbedJS.PinName.LED1,{ onNew:function(){ pin.write(1); }, onWrite:function(){ setTimeout(function(){pin.write((v++)%2);},100); }}); }, onError:function(){alert("Error!");} }); } </script> </head> <h1 id="title">LED Blink</h1> <body onload="start()"> </body> </html>
Preview