Hey everyone,
So I’ve got a new design and I have two serial devices that need to connect to an Electron. First one will connect to the good ol GND, TX, and RX pins. The second device however will need to connect to Serial2 which as I understand are available on C2(RX) and C3(TX). I went ahead and wired Serial2 to Serial 1 as shown here:
Then I flashed this code to the Electron:
#include "Serial2/Serial2.h"
SYSTEM_MODE(MANUAL);
unsigned long start = 0;
unsigned long tOut = 500;
void setup() {
Serial2.begin(115200);
Serial1.begin(115200);
}
void loop() {
for(int i = 0; i < 10; i++){
Serial2.printf("Test: %i\n", i);
unsigned long start = millis();
while(Serial1.available() == 0 && millis() < start+tOut);
if(Serial1.available() == 0){
Serial.println("No Data");
}else{
delay(10);
while(Serial1.available() != 0){
Serial.print(Serial1.read());
}
Serial.println();
}
}
}
All I see is No Data on my Particle CLI Serial log. Any ideas on this?