diff --git a/examples/javascript/Blink-IO.js b/examples/javascript/Blink-IO.js index 64eb788..75f080c 100644 --- a/examples/javascript/Blink-IO.js +++ b/examples/javascript/Blink-IO.js @@ -29,11 +29,12 @@ var myLed = new m.Gpio(13); //LED hooked up to digital pin 13 (or built in pin o myLed.dir(m.DIR_OUT); //set the gpio direction to output var ledState = true; //Boolean to hold the state of Led -periodicActivity(); //call the periodicActivity function - function periodicActivity() { myLed.write(ledState?1:0); //if ledState is true then write a '1' (high) otherwise write a '0' (low) ledState = !ledState; //invert the ledState setTimeout(periodicActivity,1000); //call the indicated function after 1 second (1000 milliseconds) } + +periodicActivity(); //call the periodicActivity function +