// blinky.js// Import the interface to Tessel hardwarevar tessel =require("tessel");// Set the led pins as outputs with initial states// Truthy initial state sets the pin high// Falsy sets it low.var led1 =tessel.led[0].output(1);var led2 =tessel.led[1].output(0);setInterval(function () {console.log("I'm blinking! (Press CTRL + C to stop)");// Toggle the led statesled1.toggle();led2.toggle();},100);
OK,執行成功就會看到藍綠兩個燈在閃爍!
$tesselrunblinky.jsTESSEL!ConnectedtoTM-00-04-f000da30-00544741-1ca82586.INFOBundlingdirectory/Users/alan/Documents/tessel-codeINFODeployingbundle (4.50 KB)...INFORunningscript...I'm blinking! (Press CTRL + C to stop)