Skip to content

Commit 0ada8fa

Browse files
Create irrigation-frontend.ino
User side program meant to be run on AdaFruit IO
1 parent 4e2db7c commit 0ada8fa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

irrigation-frontend.ino

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <ESP8266WiFi.h>
2+
#include "Adafruit_MQTT.h"
3+
#include "Adafruit_MQTT_Client.h"
4+
5+
const char *ssid = "WiFi Name"; // Enter your WiFi Name
6+
const char *pass = "Password"; // Enter your WiFi Password
7+
8+
#define MQTT_SERV "io.adafruit.com"
9+
#define MQTT_PORT 1883
10+
#define MQTT_NAME "User Name"
11+
#define MQTT_PASS "AIO Key"
12+
13+
Adafruit_MQTT_Publish AgricultureData = Adafruit_MQTT_Publish(&mqtt,MQTT_NAME "/f/AgricultureData"); //publishing feed setup
14+
Adafruit_MQTT_Subscribe LED = Adafruit_MQTT_Subscribe(&mqtt, MQTT_NAME "/f/LED");
15+
Adafruit_MQTT_Subscribe Pump = Adafruit_MQTT_Subscribe(&mqtt, MQTT_NAME "/f/Pump"); //subscribed feed setup

0 commit comments

Comments
 (0)