You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm following the example Serial2.ino, and I've slightly modified it to allow one of my V3s to be a transmitter, and one to be a receiver. I am neither transmitting nor receiving, however. How am I supposed to access UART1 on pins 2/17??
Sender code:
/*
Heltec Automation ESP32 Serial 1 & 2 example.
shows the usage of all 3 hardware uarts
work with ESP32's IO MUX
to test the software and hardware
wire Rx1 to Tx1 and Rx2 to Tx2
type text in serial monitor
text will walk trough all 2 serials
result is echoed to serial (usb)
*/
void setup() {
Serial.begin(115200);
// Serial1.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
// Serial2.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
// The txPin & rxPin can set to any output pin
// Serial1.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
// Serial2.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
// The txPin & rxPin can set to any output pin
Hi, I'm following the example Serial2.ino, and I've slightly modified it to allow one of my V3s to be a transmitter, and one to be a receiver. I am neither transmitting nor receiving, however. How am I supposed to access UART1 on pins 2/17??
Sender code:
/*
*/
void setup() {
Serial.begin(115200);
// Serial1.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
// Serial2.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
// The txPin & rxPin can set to any output pin
Serial1.begin(115200, SERIAL_8N1, 2, 17);
// Serial2.begin(115200, SERIAL_8N1, 22, 23);
}
void loop() {
//Serial.println("Serial not online");
delay(5000);
if(Serial1.available()) {
}
// if(Serial2.available()) {
// int ch = Serial2.read();
// Serial2.write(ch);
// }
// if(Serial2.available()) {
// int ch = Serial2.read();
// Serial.write(ch);
// }
}
Receiver code:
/*
*/
void setup() {
Serial.begin(115200);
// Serial1.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
// Serial2.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
// The txPin & rxPin can set to any output pin
Serial1.begin(115200, SERIAL_8N1, 2, 17);
// Serial2.begin(115200, SERIAL_8N1, 22, 23);
}
void loop() {
//Serial.println("Serial not online");
delay(5000);
if(Serial1.available()) {
int ch = Serial.read();
for(int i = 0; i<100; i++)
Serial.print(ch);
}
if(Serial2.available()) {
int ch = Serial2.read();
Serial2.write(ch);
}
if(Serial2.available()) {
int ch = Serial2.read();
Serial.write(ch);
}
}
Any help is appreciated, thank you!!!!
The text was updated successfully, but these errors were encountered: