Skip to content

Instantly share code, notes, and snippets.

@paulgureghian
Forked from gopal-amlekar/watson-sense-hat.js
Created August 23, 2017 17:23
Show Gist options
  • Save paulgureghian/b21799ddd306f0948765bd1612364bbe to your computer and use it in GitHub Desktop.
Save paulgureghian/b21799ddd306f0948765bd1612364bbe 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