Skip to content

Commit f0e9773

Browse files
committed
update to wifi101 library
1 parent 5b25a96 commit f0e9773

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

examples/mqtt_winc1500/mqtt_winc1500.ino

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@
1111
#include <SPI.h>
1212
#include "Adafruit_MQTT.h"
1313
#include "Adafruit_MQTT_Client.h"
14-
#include <Adafruit_WINC1500.h>
15-
14+
#include <WiFi101.h>
1615

1716
/************************* WiFI Setup *****************************/
1817
#define WINC_CS 8
1918
#define WINC_IRQ 7
2019
#define WINC_RST 4
2120
#define WINC_EN 2 // or, tie EN to VCC
2221

23-
Adafruit_WINC1500 WiFi(WINC_CS, WINC_IRQ, WINC_RST);
24-
2522
char ssid[] = "yournetwork"; // your network SSID (name)
2623
char pass[] = "yourpassword"; // your network password (use for WPA, or use as key for WEP)
2724
int keyIndex = 0; // your network key Index number (needed only for WEP)
@@ -38,7 +35,7 @@ int status = WL_IDLE_STATUS;
3835
/************ Global State (you don't need to change this!) ******************/
3936

4037
//Set up the wifi client
41-
Adafruit_WINC1500Client client;
38+
WiFiClient client;
4239

4340
Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY);
4441

@@ -60,10 +57,7 @@ Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAM
6057

6158

6259
void setup() {
63-
#ifdef WINC_EN
64-
pinMode(WINC_EN, OUTPUT);
65-
digitalWrite(WINC_EN, HIGH);
66-
#endif
60+
WiFi.setPins(WINC_CS, WINC_IRQ, WINC_RST, WINC_EN);
6761

6862
while (!Serial);
6963
Serial.begin(115200);
@@ -154,4 +148,4 @@ void MQTT_connect() {
154148
delay(5000); // wait 5 seconds
155149
}
156150
Serial.println("MQTT Connected!");
157-
}
151+
}

0 commit comments

Comments
 (0)