NetBurner 3.5.6
PDF Version
MQTT SubHandler GPIO Example

This example demonstrates a custom subscription handler with the easy MqttObj system, for the case where a developer wants to easily use custom logic for subscribing to messages without implementing low-level things.

Once connected, a dynamic topic name will be output to stdout. The user can send an MQTT message of 1 or 0 to that topic to turn on or off the LED pin.

Any numbered PinIO pin can be accessed in this way. For platforms that access pins like P1[int], a slash can separate the header and pin, like: pins/1/1