Skip to content

Commit

Permalink
Changed Pin-Mapping of Serial1 for ESP32
Browse files Browse the repository at this point in the history
  • Loading branch information
JRauer committed Jul 16, 2021
1 parent d8fab8b commit 2a43648
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Download this library (the whole repository) and install it in your Arduino IDE.
See these links on [how to install ESP32](https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/) and [ESP8266 boards](https://randomnerdtutorials.com/how-to-install-esp8266-board-arduino-ide/) in your Arduino IDE.

Connect the robot's **yellow cable to TX**, the **white cable to RX**.
<table><tr><th></th><th colspan="2">Serial*</th><th colspan="2">Serial1</th><th colspan="2">Serial2</th><th colspan="2">Serial3</th></tr><tr><td></td><td>RX</td><td>TX</td><td>RX</td><td>TX</td><td>RX</td><td>TX</td><td>RX</td><td>TX</td></tr><tr><td>Arduino UNO, Nano, Mini</td><td>0</td><td>1</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Arduino Leonado, Micro, Yun</td><td></td><td></td><td>0</td><td>1</td><td></td><td></td><td></td><td></td></tr><tr><td>Arduino Mega</td><td>0</td><td>1</td><td>19</td><td>18</td><td>17</td><td>16</td><td>15</td><td>14</td></tr><tr><td>ESP32</td><td>3</td><td>1</td><td>22</td><td>23</td><td>16</td><td>17</td><td></td><td></td></tr><tr><td>ESP8266</td><td>3</td><td>1</td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
<table><tr><th></th><th colspan="2">Serial*</th><th colspan="2">Serial1</th><th colspan="2">Serial2</th><th colspan="2">Serial3</th></tr><tr><td></td><td>RX</td><td>TX</td><td>RX</td><td>TX</td><td>RX</td><td>TX</td><td>RX</td><td>TX</td></tr><tr><td>Arduino UNO, Nano, Mini</td><td>0</td><td>1</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Arduino Leonado, Micro, Yun</td><td></td><td></td><td>0</td><td>1</td><td></td><td></td><td></td><td></td></tr><tr><td>Arduino Mega</td><td>0</td><td>1</td><td>19</td><td>18</td><td>17</td><td>16</td><td>15</td><td>14</td></tr><tr><td>ESP32</td><td>3</td><td>1</td><td>18</td><td>19</td><td>16</td><td>17</td><td></td><td></td></tr><tr><td>ESP8266</td><td>3</td><td>1</td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
*When using the Serial port, you HAVE TO DISCONNECT the cables while uploading code to the board. There will appear bytestrings in the serial monitor which are commands sent to the motors

### Supported robot types
Expand Down
Binary file modified robot_info/morobot_connection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/morobot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ void morobotClass::begin(const char* stream){
Serial.println(F("WARNING: Serial on ESP32 is connected to the USB-Controller, so you may get strange bytestings in the serial monitor!"));
_port = &Serial;
} else if (stream == "Serial1") {
Serial1.begin(115200, SERIAL_8N1, 22, 23); // Map the serial pins to different pins since 9/10 are not mapped
Serial1.begin(115200, SERIAL_8N1, 18, 19); // Map the serial pins to different pins since 9/10 are not mapped
_port = &Serial1;
} else if (stream == "Serial2") {
Serial2.begin(115200);
Expand Down

0 comments on commit 2a43648

Please sign in to comment.