We must define our features before #include <IoTaaP.h>
In setup() function we wil configure WiFi and connect IoTaaP to WiFi AP (with internet access)
Now it’s time to initialize MQTT object and connect IoTaaP to our CloudMQTT instance.
iotaap.mqtt.connect("iotaap_client", "farmer.cloudmqtt.com", 00000, callback, false, "USERNAME", "PASSWORD");
This line of code will connect IoTaaP to the CloudMQTT Mosquitto broker. You can get connection credentials in your instance details on CloudMQTT.
callback() is the function that will be called every time when something arrives to our subscribed topic(s). We will define this function later.
This line of code will subscribe IoTaaP to “ledstatus/led1” topic. We will define our callback in the next step.