Skip to content

Commit 0604f66

Browse files
committed
add config.h to all examples
1 parent 7e40be2 commit 0604f66

File tree

12 files changed

+288
-93
lines changed

12 files changed

+288
-93
lines changed

examples/adafruitio_00_publish/adafruitio_00_publish.ino

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,13 @@
99
// Licensed under the MIT license.
1010
//
1111
// All text above must be included in any redistribution.
12-
//
13-
14-
/************************* WiFi Access Point *********************************/
15-
16-
#define WIFI_SSID "your_ssid"
17-
#define WIFI_PASS "your_pass"
18-
19-
/************************* Adafruit IO Setup ********************************/
20-
21-
#define IO_USERNAME "your_username"
22-
#define IO_KEY "your_key"
23-
24-
/*************************** Client Setup ***********************************/
2512

26-
// The Adafruit IO WiFi client will work with the following boards:
27-
// - HUZZAH ESP8266 Breakout -> https://www.adafruit.com/products/2471
28-
// - Feather HUZZAH ESP8266 -> https://www.adafruit.com/products/2821
29-
// - Feather M0 WiFi -> https://www.adafruit.com/products/3010
30-
// - Feather WICED -> https://www.adafruit.com/products/3056
13+
/************************** Configuration ***********************************/
3114

32-
// set up the wifi client using the supplied ssid & pass
33-
#include "AdafruitIO_WiFi.h"
34-
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
15+
// edit the config.h tab and enter your Adafruit IO credentials
16+
// and any additional configuration needed for WiFi, cellular,
17+
// or ethernet clients.
18+
#include "config.h"
3519

3620
/************************ Example Starts Here *******************************/
3721

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/************************ Adafruit IO Config *******************************/
2+
3+
// visit io.adafruit.com if you need to create an account,
4+
// or if you need your Adafruit IO key.
5+
#define IO_USERNAME "your_username"
6+
#define IO_KEY "your_key"
7+
8+
/******************************* WIFI **************************************/
9+
10+
// the AdafruitIO_WiFi client will work with the following boards:
11+
// - HUZZAH ESP8266 Breakout -> https://www.adafruit.com/products/2471
12+
// - Feather HUZZAH ESP8266 -> https://www.adafruit.com/products/2821
13+
// - Feather M0 WiFi -> https://www.adafruit.com/products/3010
14+
// - Feather WICED -> https://www.adafruit.com/products/3056
15+
16+
#define WIFI_SSID "your_ssid"
17+
#define WIFI_PASS "your_pass"
18+
19+
// comment out the following two lines if you are using fona or ethernet
20+
#include "AdafruitIO_WiFi.h"
21+
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
22+
23+
24+
/******************************* FONA **************************************/
25+
26+
// the AdafruitIO_FONA client will work with the following boards:
27+
// - Feather 32u4 FONA -> https://www.adafruit.com/product/3027
28+
29+
// uncomment the following two lines for 32u4 FONA,
30+
// and comment out the AdafruitIO_WiFi client in the WIFI section above
31+
// #include "AdafruitIO_FONA.h"
32+
// AdafruitIO_FONA io(IO_USERNAME, IO_KEY);
33+
34+
35+
/**************************** ETHERNET ************************************/
36+
37+
// the AdafruitIO_Ethernet client will work with the following boards:
38+
// - Ethernet FeatherWing -> https://www.adafruit.com/products/3201
39+
40+
// uncomment the following two lines for 32u4 FONA,
41+
// and comment out the AdafruitIO_WiFi client in the WIFI section above
42+
// #include "AdafruitIO_Ethernet.h"
43+
// AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY);

examples/adafruitio_01_subscribe/adafruitio_01_subscribe.ino

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,13 @@
99
// Licensed under the MIT license.
1010
//
1111
// All text above must be included in any redistribution.
12-
//
13-
14-
/************************* WiFi Access Point *********************************/
15-
16-
#define WIFI_SSID "your_ssid"
17-
#define WIFI_PASS "your_pass"
18-
19-
/************************* Adafruit IO Setup ********************************/
20-
21-
#define IO_USERNAME "your_username"
22-
#define IO_KEY "your_key"
2312

24-
/*************************** Client Setup ***********************************/
13+
/************************** Configuration ***********************************/
2514

26-
// set up the wifi client using the supplied ssid & pass
27-
#include "AdafruitIO_WiFi.h"
28-
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
15+
// edit the config.h tab and enter your Adafruit IO credentials
16+
// and any additional configuration needed for WiFi, cellular,
17+
// or ethernet clients.
18+
#include "config.h"
2919

3020
/************************ Example Starts Here *******************************/
3121

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/************************ Adafruit IO Config *******************************/
2+
3+
// visit io.adafruit.com if you need to create an account,
4+
// or if you need your Adafruit IO key.
5+
#define IO_USERNAME "your_username"
6+
#define IO_KEY "your_key"
7+
8+
/******************************* WIFI **************************************/
9+
10+
// the AdafruitIO_WiFi client will work with the following boards:
11+
// - HUZZAH ESP8266 Breakout -> https://www.adafruit.com/products/2471
12+
// - Feather HUZZAH ESP8266 -> https://www.adafruit.com/products/2821
13+
// - Feather M0 WiFi -> https://www.adafruit.com/products/3010
14+
// - Feather WICED -> https://www.adafruit.com/products/3056
15+
16+
#define WIFI_SSID "your_ssid"
17+
#define WIFI_PASS "your_pass"
18+
19+
// comment out the following two lines if you are using fona or ethernet
20+
#include "AdafruitIO_WiFi.h"
21+
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
22+
23+
24+
/******************************* FONA **************************************/
25+
26+
// the AdafruitIO_FONA client will work with the following boards:
27+
// - Feather 32u4 FONA -> https://www.adafruit.com/product/3027
28+
29+
// uncomment the following two lines for 32u4 FONA,
30+
// and comment out the AdafruitIO_WiFi client in the WIFI section above
31+
// #include "AdafruitIO_FONA.h"
32+
// AdafruitIO_FONA io(IO_USERNAME, IO_KEY);
33+
34+
35+
/**************************** ETHERNET ************************************/
36+
37+
// the AdafruitIO_Ethernet client will work with the following boards:
38+
// - Ethernet FeatherWing -> https://www.adafruit.com/products/3201
39+
40+
// uncomment the following two lines for 32u4 FONA,
41+
// and comment out the AdafruitIO_WiFi client in the WIFI section above
42+
// #include "AdafruitIO_Ethernet.h"
43+
// AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY);

examples/adafruitio_02_pubsub/adafruitio_02_pubsub.ino

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,13 @@
99
// Licensed under the MIT license.
1010
//
1111
// All text above must be included in any redistribution.
12-
//
13-
14-
/************************* WiFi Access Point *********************************/
15-
16-
#define WIFI_SSID "your_ssid"
17-
#define WIFI_PASS "your_pass"
18-
19-
/************************* Adafruit IO Setup ********************************/
20-
21-
#define IO_USERNAME "your_username"
22-
#define IO_KEY "your_key"
2312

24-
/*************************** Client Setup ***********************************/
13+
/************************** Configuration ***********************************/
2514

26-
// set up the wifi client using the supplied ssid & pass
27-
#include "AdafruitIO_WiFi.h"
28-
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
15+
// edit the config.h tab and enter your Adafruit IO credentials
16+
// and any additional configuration needed for WiFi, cellular,
17+
// or ethernet clients.
18+
#include "config.h"
2919

3020
/************************ Example Starts Here *******************************/
3121

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/************************ Adafruit IO Config *******************************/
2+
3+
// visit io.adafruit.com if you need to create an account,
4+
// or if you need your Adafruit IO key.
5+
#define IO_USERNAME "your_username"
6+
#define IO_KEY "your_key"
7+
8+
/******************************* WIFI **************************************/
9+
10+
// the AdafruitIO_WiFi client will work with the following boards:
11+
// - HUZZAH ESP8266 Breakout -> https://www.adafruit.com/products/2471
12+
// - Feather HUZZAH ESP8266 -> https://www.adafruit.com/products/2821
13+
// - Feather M0 WiFi -> https://www.adafruit.com/products/3010
14+
// - Feather WICED -> https://www.adafruit.com/products/3056
15+
16+
#define WIFI_SSID "your_ssid"
17+
#define WIFI_PASS "your_pass"
18+
19+
// comment out the following two lines if you are using fona or ethernet
20+
#include "AdafruitIO_WiFi.h"
21+
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
22+
23+
24+
/******************************* FONA **************************************/
25+
26+
// the AdafruitIO_FONA client will work with the following boards:
27+
// - Feather 32u4 FONA -> https://www.adafruit.com/product/3027
28+
29+
// uncomment the following two lines for 32u4 FONA,
30+
// and comment out the AdafruitIO_WiFi client in the WIFI section above
31+
// #include "AdafruitIO_FONA.h"
32+
// AdafruitIO_FONA io(IO_USERNAME, IO_KEY);
33+
34+
35+
/**************************** ETHERNET ************************************/
36+
37+
// the AdafruitIO_Ethernet client will work with the following boards:
38+
// - Ethernet FeatherWing -> https://www.adafruit.com/products/3201
39+
40+
// uncomment the following two lines for 32u4 FONA,
41+
// and comment out the AdafruitIO_WiFi client in the WIFI section above
42+
// #include "AdafruitIO_Ethernet.h"
43+
// AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY);

examples/adafruitio_03_multiple_feeds/adafruitio_03_multiple_feeds.ino

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,12 @@
1010
//
1111
// All text above must be included in any redistribution.
1212

13-
/************************* WiFi Access Point *********************************/
13+
/************************** Configuration ***********************************/
1414

15-
#define WIFI_SSID "your_ssid"
16-
#define WIFI_PASS "your_pass"
17-
18-
/************************* Adafruit IO Setup ********************************/
19-
20-
#define IO_USERNAME "your_username"
21-
#define IO_KEY "your_key"
22-
23-
/*************************** Client Setup ***********************************/
24-
25-
// set up the wifi client using the supplied ssid & pass
26-
#include "AdafruitIO_WiFi.h"
27-
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
15+
// edit the config.h tab and enter your Adafruit IO credentials
16+
// and any additional configuration needed for WiFi, cellular,
17+
// or ethernet clients.
18+
#include "config.h"
2819

2920
/************************ Example Starts Here *******************************/
3021

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/************************ Adafruit IO Config *******************************/
2+
3+
// visit io.adafruit.com if you need to create an account,
4+
// or if you need your Adafruit IO key.
5+
#define IO_USERNAME "your_username"
6+
#define IO_KEY "your_key"
7+
8+
/******************************* WIFI **************************************/
9+
10+
// the AdafruitIO_WiFi client will work with the following boards:
11+
// - HUZZAH ESP8266 Breakout -> https://www.adafruit.com/products/2471
12+
// - Feather HUZZAH ESP8266 -> https://www.adafruit.com/products/2821
13+
// - Feather M0 WiFi -> https://www.adafruit.com/products/3010
14+
// - Feather WICED -> https://www.adafruit.com/products/3056
15+
16+
#define WIFI_SSID "your_ssid"
17+
#define WIFI_PASS "your_pass"
18+
19+
// comment out the following two lines if you are using fona or ethernet
20+
#include "AdafruitIO_WiFi.h"
21+
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
22+
23+
24+
/******************************* FONA **************************************/
25+
26+
// the AdafruitIO_FONA client will work with the following boards:
27+
// - Feather 32u4 FONA -> https://www.adafruit.com/product/3027
28+
29+
// uncomment the following two lines for 32u4 FONA,
30+
// and comment out the AdafruitIO_WiFi client in the WIFI section above
31+
// #include "AdafruitIO_FONA.h"
32+
// AdafruitIO_FONA io(IO_USERNAME, IO_KEY);
33+
34+
35+
/**************************** ETHERNET ************************************/
36+
37+
// the AdafruitIO_Ethernet client will work with the following boards:
38+
// - Ethernet FeatherWing -> https://www.adafruit.com/products/3201
39+
40+
// uncomment the following two lines for 32u4 FONA,
41+
// and comment out the AdafruitIO_WiFi client in the WIFI section above
42+
// #include "AdafruitIO_Ethernet.h"
43+
// AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY);

examples/adafruitio_04_location/adafruitio_04_location.ino

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,12 @@
1010
//
1111
// All text above must be included in any redistribution.
1212

13-
/************************* WiFi Access Point *********************************/
13+
/************************** Configuration ***********************************/
1414

15-
#define WIFI_SSID "your_ssid"
16-
#define WIFI_PASS "your_pass"
17-
18-
/************************* Adafruit IO Setup ********************************/
19-
20-
#define IO_USERNAME "your_username"
21-
#define IO_KEY "your_key"
22-
23-
/*************************** Client Setup ***********************************/
24-
25-
// set up the wifi client using the supplied ssid & pass
26-
#include "AdafruitIO_WiFi.h"
27-
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
15+
// edit the config.h tab and enter your Adafruit IO credentials
16+
// and any additional configuration needed for WiFi, cellular,
17+
// or ethernet clients.
18+
#include "config.h"
2819

2920
/************************ Example Starts Here *******************************/
3021

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/************************ Adafruit IO Config *******************************/
2+
3+
// visit io.adafruit.com if you need to create an account,
4+
// or if you need your Adafruit IO key.
5+
#define IO_USERNAME "your_username"
6+
#define IO_KEY "your_key"
7+
8+
/******************************* WIFI **************************************/
9+
10+
// the AdafruitIO_WiFi client will work with the following boards:
11+
// - HUZZAH ESP8266 Breakout -> https://www.adafruit.com/products/2471
12+
// - Feather HUZZAH ESP8266 -> https://www.adafruit.com/products/2821
13+
// - Feather M0 WiFi -> https://www.adafruit.com/products/3010
14+
// - Feather WICED -> https://www.adafruit.com/products/3056
15+
16+
#define WIFI_SSID "your_ssid"
17+
#define WIFI_PASS "your_pass"
18+
19+
// comment out the following two lines if you are using fona or ethernet
20+
#include "AdafruitIO_WiFi.h"
21+
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
22+
23+
24+
/******************************* FONA **************************************/
25+
26+
// the AdafruitIO_FONA client will work with the following boards:
27+
// - Feather 32u4 FONA -> https://www.adafruit.com/product/3027
28+
29+
// uncomment the following two lines for 32u4 FONA,
30+
// and comment out the AdafruitIO_WiFi client in the WIFI section above
31+
// #include "AdafruitIO_FONA.h"
32+
// AdafruitIO_FONA io(IO_USERNAME, IO_KEY);
33+
34+
35+
/**************************** ETHERNET ************************************/
36+
37+
// the AdafruitIO_Ethernet client will work with the following boards:
38+
// - Ethernet FeatherWing -> https://www.adafruit.com/products/3201
39+
40+
// uncomment the following two lines for 32u4 FONA,
41+
// and comment out the AdafruitIO_WiFi client in the WIFI section above
42+
// #include "AdafruitIO_Ethernet.h"
43+
// AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY);

0 commit comments

Comments
 (0)