// create a global variabled called led, // and assign pin9 to it led <- hardware.pin9; // configure led to be a digital output led.configure(DIGITAL_OUT); // function to turn LED on or off function stopMotor(flagState) { server.log("Set Flag: " + flagState); local temp = 0 + flagState; // Cast issue led.write(temp); } // register a handler for "led" messages from the agent agent.on("signalStopMotor", stopMotor);