добавлены комментарии по выбору пинов для разных плат. Для стартовых примеров добавлен ifdef для автоматического задания корректных выводов

This commit is contained in:
klassents committed 2025-07-29 14:26:53 +07:00
1 parent f45757f13c
commit 53511ffbe2
33 files changed
+280 -169

No files matched your search

@@ -5,13 +5,14 @@
Receives from software serial, sends to hardware serial.
The circuit:
* RX is digital pin 2 (connect to TX of other device)
* TX is digital pin 6 (connect to RX of other device)
* RX is digital pin 2 (P0_10) (connect to TX of other device)
* TX is digital pin 6 (P0_2) (connect to RX of other device)
Note:
Not all pins on the Elbear Ace-Uno support interrupts,
so only the following can be used for RX:
2, 3, 4, 5, 8, 9
Not all pins on the Elbear Ace-Uno/Ace-Nano support interrupts,
so only the following can be used for RX: 2, 3, 4, 5, 8, 9
Elsomik board pins with interrupts: P0_8, P1_4, P1_5, P1_6, P1_9, P1_10, P1_15, P2_7
Start board pins with interrupts: P0_10, P0_12, P0_13, P0_14, P0_15, P1_9, P1_15
created back in the mists of time
modified 25 May 2012
@@ -22,8 +23,9 @@
*/
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 6); // RX, TX
int rx_pin = 2; // P1_9 for Start/Elsomik
int tx_pin = 6; // P0_2 for Start/Elsomik
SoftwareSerial mySerial(rx_pin, tx_pin);
void setup() {
// Open serial communications and wait for port to open:
@@ -17,17 +17,22 @@
* Second serial device's TX attached to digital pin 8(RX), RX to pin 10(TX)
Note:
Not all pins on the Elbear Ace-Uno support interrupts,
so only the following can be used for RX:
2, 3, 4, 5, 8, 9
Not all pins on the Elbear Ace-Uno/Ace-Nano support interrupts,
so only the following can be used for RX: 2, 3, 4, 5, 8, 9
Elsomik board pins with interrupts: P0_8, P1_4, P1_5, P1_6, P1_9, P1_10, P1_15, P2_7
Start board pins with interrupts: P0_10, P0_12, P0_13, P0_14, P0_15, P1_9, P1_15
*/
#include <SoftwareSerial.h>
// software serial #1: RX = digital pin 2, TX = digital pin 6
SoftwareSerial portOne(2, 6);
int rx_pin_1 = 2; // P1_9 for Start/Elsomik
int tx_pin_1 = 6; // P0_2 for Start/Elsomik
SoftwareSerial portOne(rx_pin_1, tx_pin_1);
// software serial #2: RX = digital pin 8, TX = digital pin 10
SoftwareSerial portTwo(8, 10);
int rx_pin_2 = 8; // P1_15 for Start/Elsomik
int tx_pin_2 = 10; // P1_3 for Start/Elsomik
SoftwareSerial portTwo(rx_pin_2, tx_pin_2);
// active port is changed by user button pressing
volatile bool isPortOneActive = true;