I have a boron 404x and argon wifi. I need to check if I fried both pins or not. What code should I use to self test the boards so I can connect wire tx to rx like bridge?
You just Serial1.write()
some data and see whether you can Serial1.read()
back that exact same data.
If that works, you’re fine.
If not you may want to see which pin is fried and that can be done via the standard pin I/O operations digitalRead()
and digitalWrite()
in conjunction with some other GPIO or external test equipment (LEDs, DMM, oscilloscope, logic analyzer, …).
Could you please put a example code for Serial1.write()
How about this
(just replace Serial.
with Serial1.
)
@onlinegill, connect RX to TX with a jumper then try this code. It sends a short “Test” string of text to Serial1 which will be buffered by the receiving DeviceOS code. Then, the Serial1 receive buffer is read and the characters are written to the USB Serial port. If all works well, you should see the “Test” message printed out.
void setup() {
Serial.begin();
Serial1.begin(9600);
// Wait for PC to open and connect to USB Serial port
while(!Serial.isConnected()) Particle.process();
Serial1.print("Test");
Serial.print("Received: ");
}
void loop() {
char recv;
if (Serial1.available() > 0) {
recv = Serial1.read();
Serial.write(recv);
}
}
Thank you looks like I killed tx /rx pins as I don’t see test received. anyway I could use other pins for this purpose?
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.