Skip to content

Instantly share code, notes, and snippets.

@ElectricImpSampleCode
Last active September 10, 2018 10:51
Show Gist options
  • Save ElectricImpSampleCode/0c334e21151e814ac737 to your computer and use it in GitHub Desktop.
Save ElectricImpSampleCode/0c334e21151e814ac737 to your computer and use it in GitHub Desktop.
A code snippet that demonstrates server.sleepfor().
// Set the deep sleep trigger to take place only when the imp is idle
imp.onidle(function() {
// Inform the agent that the device will now sleep for one hour
// NOTE time specified in seconds
server.sleepfor(3600);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment