Now let's add MQTT functionality. What we want to achieve is the following.
The Arduino should subscribe to the /yourname/feeder/feed topic. The namespace consists of three parts: yourname, which you can freely pick, should unify all of your MQTT experiments; feeder, which is the name of your device (you could also give it a longer name, such as food-dispenser); and feed, which is a command we use to release one portion of food. We could also add other commands here. One command that would be good to add is status, to which the device sends a message when it connects or disconnects to the internet and MQTT server. Its namespace would look like this: /yourname/feeder/status. Feel free to add this functionality later on.
To make our feeder accessible via MQTT, we need to combine our current sketch with the MQTT test code...