Created
August 22, 2017 16:07
-
-
Save gopal-amlekar/360aa4936a2f213162bd27b061c52c7c to your computer and use it in GitHub Desktop.
Short code to interpret commands and parse it to sense hat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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