|
2 | 2 |
|
3 | 3 | // visit io.adafruit.com if you need to create an account,
|
4 | 4 | // or if you need your Adafruit IO key.
|
5 |
| -#define IO_USERNAME "your_username" |
6 |
| -#define IO_KEY "your_key" |
| 5 | +#define IO_USERNAME "your_username" |
| 6 | +#define IO_KEY "your_key" |
7 | 7 |
|
8 | 8 | /******************************* WIFI **************************************/
|
9 | 9 |
|
|
17 | 17 | // - Adafruit Metro M4 Express AirLift Lite -> https://www.adafruit.com/product/4000
|
18 | 18 | // - Adafruit AirLift Breakout -> https://www.adafruit.com/product/4201
|
19 | 19 |
|
20 |
| -#define WIFI_SSID "your_ssid" |
21 |
| -#define WIFI_PASS "your_pass" |
| 20 | +#define WIFI_SSID "your_ssid" |
| 21 | +#define WIFI_PASS "your_pass" |
22 | 22 |
|
23 |
| -// uncomment the following line if you are using airlift, |
| 23 | +// uncomment the following line if you are using airlift |
24 | 24 | // #define USE_AIRLIFT
|
25 | 25 |
|
26 |
| -// uncomment the following line if you are using winc1500, |
| 26 | +// uncomment the following line if you are using winc1500 |
27 | 27 | // #define USE_WINC1500
|
28 | 28 |
|
29 |
| -// comment out the following two lines if you are using fona or ethernet |
| 29 | +// comment out the following lines if you are using fona or ethernet |
30 | 30 | #include "AdafruitIO_WiFi.h"
|
31 | 31 |
|
| 32 | +#ifdef USE_AIRLIFT |
| 33 | +// Configure the pins used for the ESP32 connection |
| 34 | +#if !defined(SPIWIFI_SS) // if the wifi definition isnt in the board variant |
| 35 | +// Don't change the names of these #define's! they match the variant ones |
| 36 | +#define SPIWIFI SPI |
| 37 | +#define SPIWIFI_SS 10 // Chip select pin |
| 38 | +#define SPIWIFI_ACK 9 // a.k.a BUSY or READY pin |
| 39 | +#define ESP32_RESETN 6 // Reset pin |
| 40 | +#define ESP32_GPIO0 -1 // Not connected |
| 41 | +#endif |
| 42 | +AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS, SPIWIFI_SS, SPIWIFI_ACK, ESP32_RESETN, ESP32_GPIO0, &SPIWIFI); |
| 43 | +#else |
32 | 44 | AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
|
33 |
| - |
34 |
| -// uncomment the following line if you are using airlift |
35 |
| -// and comment out the AdafruitIO_WiFi client above |
36 |
| -// AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS, SPIWIFI_SS, SPIWIFI_ACK, ESP32_RESETN, ESP32_GPIO0, &SPIWIFI); |
37 |
| - |
| 45 | +#endif |
38 | 46 | /******************************* FONA **************************************/
|
39 | 47 |
|
40 | 48 | // the AdafruitIO_FONA client will work with the following boards:
|
|
0 commit comments