Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers.

Is it possible to send Jevois serial monitor message to Arduino?

+2 votes
Hello, I have succeeded in passing serial commands from Jevois to Arduino and vice versa, however, there is one more thing I'd wish to do. I'd like to display the serial monitor output from Jevois's "help" and "listmappings" command to Arduino's serial monitor as well. Is there a way to do this? Would Serial1.readBytesUntil solve the problem in any way?
asked Jul 16, 2018 in Programmer Questions by JeVoisNewbie (420 points)

1 Answer

+1 vote
 
Best answer

It is very simple. Just use a modified version of the Arduino example "SerialPassThrough".

The modification is changing the "Serial.write..." to "Serial.print..."

Something like this:

void loop() {
    if (Serial1.available()) {     // If anything comes in Serial1 (pins 0 & 1)
    Serial.print(Serial1.read());   // read it and send it out Serial (USB)
  }
}

answered Jul 16, 2018 by Billbo911 (1,080 points)
selected Jul 17, 2018 by JeVoisNewbie
Thank you for answering my question! The code you shared with me resulted in integer outputs. By adding an additional "(char)" converter to your code, it works like a charm!

from
Serial.print(Serial1.read());

to
Serial.print((char)Serial1.read());

Also, I think I set my "Serial1.setTimeout()" parameter to be too small, so that might have been an issue as well.
Thank you so much for your help!
...