This file contains hidden or 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'; | |
} |
This file contains hidden or 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
import android.app.Activity; | |
import android.app.Service; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.os.Bundle; | |
import android.os.IBinder; | |
import android.support.v4.content.LocalBroadcastManager; |