Skip to content

Instantly share code, notes, and snippets.

@gopal-amlekar
Created August 22, 2017 16:07
Show Gist options
  • Save gopal-amlekar/360aa4936a2f213162bd27b061c52c7c to your computer and use it in GitHub Desktop.
Save gopal-amlekar/360aa4936a2f213162bd27b061c52c7c to your computer and use it in GitHub Desktop.
Short code to interpret commands and parse it to sense hat
// screen on command to turn on the entire display to Red. Otherwise it stays green.
// Extend the function to interpret more commands as required.
// Sense hat commands are described in the info for sense hat node.
if (msg.payload === 'screen on'){
msg.payload = '*,*,red';
}
else{
msg.payload = '*,*,green';
}
return msg;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment