Skip to content

Commit

Permalink
SerialWiFiOTA example - emulate Serial1 on pins 6/7 if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
JAndrassy committed Sep 10, 2022
1 parent 6969219 commit 74b6d58
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions examples/SerialWiFiOTA/SerialWiFiOTA.ino
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/*
This example polls for sketch updates over WiFi module on Serial1,
sketches can be updated by selecting a network port from within
the Arduino IDE: Tools -> Port -> Network Ports ...
This example polls for sketch updates over WiFi module on Serial1.
created 13 July 2010
by dlf (Metodo2 srl)
Expand All @@ -16,6 +14,16 @@

#include <WiFiEspAT.h>
#include <ArduinoOTA.h>
#include <SoftwareSerial.h>

// Emulate Serial1 on pins 6/7 if not present
#if defined(ARDUINO_ARCH_AVR) && !defined(HAVE_HWSERIAL1)
#include <SoftwareSerial.h>
SoftwareSerial Serial1(6, 7); // RX, TX
#define AT_BAUD_RATE 9600
#else
#define AT_BAUD_RATE 115200
#endif

void setup() {

Expand Down

0 comments on commit 74b6d58

Please sign in to comment.