diff --git a/examples/ArduinoIoTCloud_LED_switch/arduino_secrets.h b/examples/ArduinoIoTCloud_LED_switch/arduino_secrets.h index 3f5bb26cf..343d85ce9 100644 --- a/examples/ArduinoIoTCloud_LED_switch/arduino_secrets.h +++ b/examples/ArduinoIoTCloud_LED_switch/arduino_secrets.h @@ -9,7 +9,7 @@ If you prefer using a MKR GSM 1400 comment the lines above and uncommet the following. PIN, APN, Login and Password are supplied by your Cellular Data provider. */ -//#define SECRET_PIN "" -//#define SECRET_APN "" -//#define SECRET_LOGIN "" -//#define SECRET_PASS "" +#define SECRET_PIN "" +#define SECRET_APN "" +#define SECRET_LOGIN "" +#define SECRET_PASS "" diff --git a/examples/ArduinoIoTCloud_LED_switch/thingProperties.h b/examples/ArduinoIoTCloud_LED_switch/thingProperties.h index 07481610c..79edd5f52 100644 --- a/examples/ArduinoIoTCloud_LED_switch/thingProperties.h +++ b/examples/ArduinoIoTCloud_LED_switch/thingProperties.h @@ -1,12 +1,14 @@ #include -/* - The following include line is used for WiFi enabled boards (MKR1000, MKR WiFi 1010) -*/ -#include -/* - If you prefer using a MKR GSM 1400 comment the line above and uncommet the following. -*/ -//#include +#include + +#if defined(BOARD_HAS_WIFI) + #include +#elif defined(BOARD_HAS_GSM) + #include +#else + #error "Arduino IoT Cloud currently only supports MKR1000, MKR WiFi 1010 and MKR GSM 1400" +#endif + // Your THING_ID #define THING_ID "ARDUINO_IOT_CLOUD_THING_ID" @@ -22,11 +24,10 @@ void initProperties() { ArduinoCloud.addProperty(potentiometer, READ, ON_CHANGE); } -/* - The following include line is used for WiFi enabled boards (MKR1000, MKR WiFi 1010) -*/ -ConnectionManager *ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_SSID, SECRET_PASS); -/* - If you prefer using a MKR GSM 1400 comment the line above and uncommet the following. -*/ -//ConnectionManager *ArduinoIoTPreferredConnection = new GSMConnectionManager(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS); +#if defined(BOARD_HAS_WIFI) +ConnectionManager * ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_SSID, SECRET_PASS); +#elif defined(BOARD_HAS_GSM) +ConnectionManager * ArduinoIoTPreferredConnection = new GSMConnectionManager (SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS); +#endif + +