# MiMic Javascript Editor

Play
Stop
Save
Source code
<!DOCTYPE html> <html><head> <meta charset="UTF-8"> <script src="/rom/MiMicCore-mini.js"></script> <script src="/rom/MbedM3.All-mini.js"></script> <script type="text/javascript"> function start() { //DIGITAL OUT pin-option var DIGITAL_OUT={dir:1,pin:{mode:1,od:0}}; try{ var mcu=new MbedM3.Mcu(location.host); var pin=mcu.getPin(MbedM3.LED[0],"GPIO"); pin.setOpt(DIGITAL_OUT); var i=0; setInterval(function(){pin.setValue((i++)%2);},500); }catch(e){ alert("catch exception!\n"+e); } } </script> </head> <h1 id="title">LED Blink</h1> <body onload="start()"> </body>
Preview