Skip to content

Commit 7a2788a

Browse files
committed
move example
1 parent e4318b4 commit 7a2788a

File tree

2 files changed

+10
-67
lines changed

2 files changed

+10
-67
lines changed

examples/ConnectionHandlerDemo/ConnectionHandlerDemo.ino

+10
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
* NBConnectionHandler conMan(SECRET_PIN);
1717
*/
1818

19+
20+
//#define ARDUINO_ETHERNET_SHIELD /* Uncomment this line if you want to use a ethernet shield */
21+
1922
#include "arduino_secrets.h"
2023

2124
#include <Arduino_ConnectionHandler.h>
@@ -28,11 +31,18 @@ GSMConnectionHandler conMan(SECRET_APN, SECRET_PIN, SECRET_GSM_USER, SECRET_GSM_
2831
NBConnectionHandler conMan(SECRET_PIN);
2932
#elif defined(BOARD_HAS_LORA)
3033
LoRaConnectionHandler conMan(SECRET_APP_EUI, SECRET_APP_KEY);
34+
#elif defined(BOARD_HAS_ETHERNET)
35+
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
36+
EthernetConnectionHandler conMan(mac);
3137
#endif
3238

3339
void setup() {
3440
Serial.begin(9600);
3541
/* Give a few seconds for the Serial connection to be available */
42+
#if defined(BOARD_HAS_ETHERNET)
43+
SPI.begin();
44+
Ethernet.init(10); // CS pin on most Arduino shields
45+
#endif
3646
delay(4000);
3747

3848
setDebugMessageLevel(DBG_INFO);

examples/Ethernet_ConnectionHandlerDemo/Ethernet_ConnectionHandlerDemo.ino

-67
This file was deleted.

0 commit comments

Comments
 (0)