Removed main.cpp
This commit is contained in:
parent
097e49fd44
commit
299d645191
25
main.cpp
25
main.cpp
@ -1,25 +0,0 @@
|
|||||||
#include <Arduino.h>
|
|
||||||
|
|
||||||
#define EXTERNAL_RX_PIN 16 // GPIO pin for the external device's TX
|
|
||||||
#define EXTERNAL_TX_PIN 17 // GPIO pin for the external device's RX
|
|
||||||
#define BAUD_RATE 115200
|
|
||||||
|
|
||||||
void setup() {
|
|
||||||
// Initialize communication with the computer (via USB-to-UART chip)
|
|
||||||
Serial.begin(BAUD_RATE);
|
|
||||||
|
|
||||||
// Initialize communication with the external device (on designated GPIO pins)
|
|
||||||
Serial2.begin(BAUD_RATE, SERIAL_8N1, EXTERNAL_RX_PIN, EXTERNAL_TX_PIN);
|
|
||||||
}
|
|
||||||
|
|
||||||
void loop() {
|
|
||||||
// Read from computer (Serial) and send to external device (Serial2)
|
|
||||||
if (Serial.available()) {
|
|
||||||
Serial2.write(Serial.read());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read from external device (Serial2) and send to computer (Serial)
|
|
||||||
if (Serial2.available()) {
|
|
||||||
Serial.write(Serial2.read());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user