Skip to content

Commit c9532ca

Browse files
author
brentru
committed
bump minor version, apply example0 config.h to all examples
1 parent 9be20a5 commit c9532ca

File tree

25 files changed

+412
-220
lines changed

25 files changed

+412
-220
lines changed

examples/adafruitio_01_subscribe/config.h

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
// visit io.adafruit.com if you need to create an account,
44
// 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"
77

88
/******************************* WIFI **************************************/
99

@@ -17,24 +17,32 @@
1717
// - Adafruit Metro M4 Express AirLift Lite -> https://www.adafruit.com/product/4000
1818
// - Adafruit AirLift Breakout -> https://www.adafruit.com/product/4201
1919

20-
#define WIFI_SSID "your_ssid"
21-
#define WIFI_PASS "your_pass"
20+
#define WIFI_SSID "your_ssid"
21+
#define WIFI_PASS "your_pass"
2222

23-
// uncomment the following line if you are using airlift,
23+
// uncomment the following line if you are using airlift
2424
// #define USE_AIRLIFT
2525

26-
// uncomment the following line if you are using winc1500,
26+
// uncomment the following line if you are using winc1500
2727
// #define USE_WINC1500
2828

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
3030
#include "AdafruitIO_WiFi.h"
3131

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
3244
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
3846
/******************************* FONA **************************************/
3947

4048
// the AdafruitIO_FONA client will work with the following boards:

examples/adafruitio_02_pubsub/config.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,29 @@
2020
#define WIFI_SSID "your_ssid"
2121
#define WIFI_PASS "your_pass"
2222

23-
// uncomment the following line if you are using airlift,
23+
// uncomment the following line if you are using airlift
2424
// #define USE_AIRLIFT
2525

26-
// uncomment the following line if you are using winc1500,
26+
// uncomment the following line if you are using winc1500
2727
// #define USE_WINC1500
2828

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
3030
#include "AdafruitIO_WiFi.h"
3131

32-
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-
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
44+
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
45+
#endif
3846
/******************************* FONA **************************************/
3947

4048
// the AdafruitIO_FONA client will work with the following boards:

examples/adafruitio_03_multiple_feeds/config.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,29 @@
2020
#define WIFI_SSID "your_ssid"
2121
#define WIFI_PASS "your_pass"
2222

23-
// uncomment the following line if you are using airlift,
23+
// uncomment the following line if you are using airlift
2424
// #define USE_AIRLIFT
2525

26-
// uncomment the following line if you are using winc1500,
26+
// uncomment the following line if you are using winc1500
2727
// #define USE_WINC1500
2828

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
3030
#include "AdafruitIO_WiFi.h"
3131

32-
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-
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
44+
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
45+
#endif
3846
/******************************* FONA **************************************/
3947

4048
// the AdafruitIO_FONA client will work with the following boards:

examples/adafruitio_04_location/config.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,29 @@
2020
#define WIFI_SSID "your_ssid"
2121
#define WIFI_PASS "your_pass"
2222

23-
// uncomment the following line if you are using airlift,
23+
// uncomment the following line if you are using airlift
2424
// #define USE_AIRLIFT
2525

26-
// uncomment the following line if you are using winc1500,
26+
// uncomment the following line if you are using winc1500
2727
// #define USE_WINC1500
2828

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
3030
#include "AdafruitIO_WiFi.h"
3131

32-
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-
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
44+
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
45+
#endif
3846
/******************************* FONA **************************************/
3947

4048
// the AdafruitIO_FONA client will work with the following boards:

examples/adafruitio_05_type_conversion/config.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,29 @@
2020
#define WIFI_SSID "your_ssid"
2121
#define WIFI_PASS "your_pass"
2222

23-
// uncomment the following line if you are using airlift,
23+
// uncomment the following line if you are using airlift
2424
// #define USE_AIRLIFT
2525

26-
// uncomment the following line if you are using winc1500,
26+
// uncomment the following line if you are using winc1500
2727
// #define USE_WINC1500
2828

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
3030
#include "AdafruitIO_WiFi.h"
3131

32-
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-
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
44+
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
45+
#endif
3846
/******************************* FONA **************************************/
3947

4048
// the AdafruitIO_FONA client will work with the following boards:

examples/adafruitio_06_digital_in/config.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,29 @@
2020
#define WIFI_SSID "your_ssid"
2121
#define WIFI_PASS "your_pass"
2222

23-
// uncomment the following line if you are using airlift,
23+
// uncomment the following line if you are using airlift
2424
// #define USE_AIRLIFT
2525

26-
// uncomment the following line if you are using winc1500,
26+
// uncomment the following line if you are using winc1500
2727
// #define USE_WINC1500
2828

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
3030
#include "AdafruitIO_WiFi.h"
3131

32-
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-
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
44+
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
45+
#endif
3846
/******************************* FONA **************************************/
3947

4048
// the AdafruitIO_FONA client will work with the following boards:

examples/adafruitio_07_digital_out/config.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,29 @@
2020
#define WIFI_SSID "your_ssid"
2121
#define WIFI_PASS "your_pass"
2222

23-
// uncomment the following line if you are using airlift,
23+
// uncomment the following line if you are using airlift
2424
// #define USE_AIRLIFT
2525

26-
// uncomment the following line if you are using winc1500,
26+
// uncomment the following line if you are using winc1500
2727
// #define USE_WINC1500
2828

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
3030
#include "AdafruitIO_WiFi.h"
3131

32-
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-
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
44+
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
45+
#endif
3846
/******************************* FONA **************************************/
3947

4048
// the AdafruitIO_FONA client will work with the following boards:

examples/adafruitio_08_analog_in/config.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,29 @@
2020
#define WIFI_SSID "your_ssid"
2121
#define WIFI_PASS "your_pass"
2222

23-
// uncomment the following line if you are using airlift,
23+
// uncomment the following line if you are using airlift
2424
// #define USE_AIRLIFT
2525

26-
// uncomment the following line if you are using winc1500,
26+
// uncomment the following line if you are using winc1500
2727
// #define USE_WINC1500
2828

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
3030
#include "AdafruitIO_WiFi.h"
3131

32-
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-
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
44+
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
45+
#endif
3846
/******************************* FONA **************************************/
3947

4048
// the AdafruitIO_FONA client will work with the following boards:

examples/adafruitio_09_analog_out/config.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,29 @@
2020
#define WIFI_SSID "your_ssid"
2121
#define WIFI_PASS "your_pass"
2222

23-
// uncomment the following line if you are using airlift,
23+
// uncomment the following line if you are using airlift
2424
// #define USE_AIRLIFT
2525

26-
// uncomment the following line if you are using winc1500,
26+
// uncomment the following line if you are using winc1500
2727
// #define USE_WINC1500
2828

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
3030
#include "AdafruitIO_WiFi.h"
3131

32-
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-
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
44+
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
45+
#endif
3846
/******************************* FONA **************************************/
3947

4048
// the AdafruitIO_FONA client will work with the following boards:

0 commit comments

Comments
 (0)