public class NeoPixel extends AbstractIndicator
robot, robotId, robotMqttClient
Constructor and Description |
---|
NeoPixel(Robot robot,
RobotMqttClient mqttClient)
NeoPixel class
|
Modifier and Type | Method and Description |
---|---|
void |
changeColor(int red,
int green,
int blue)
Change the color of the NeoPixel Ring (inform the server and GUI)
|
void |
handleSubscription(Robot r,
MqttMsg m)
Handle NeoPixel related MQTT subscriptions
|
protected void |
subscribe(swarm.robot.indicator.NeoPixel.mqttTopic key,
java.lang.String topic)
Subscribe to a MQTT topic
|
public NeoPixel(Robot robot, RobotMqttClient mqttClient)
robot
- robot objectmqttClient
- mqttClient objectprotected void subscribe(swarm.robot.indicator.NeoPixel.mqttTopic key, java.lang.String topic)
key
- Subscription topic keytopic
- Subscription topic valuepublic void handleSubscription(Robot r, MqttMsg m) throws org.json.simple.parser.ParseException
handleSubscription
in class AbstractIndicator
robot
- Robot objectm
- Subscription topic received objectorg.json.simple.parser.ParseException
public void changeColor(int red, int green, int blue)
red
- Red intensity, [0,255]green
- Green intensity, [0,255]blue
- Blue intensity, [0,255]