The baud rates of the 2 ports do not have to be the same as long as the device that the port is talking to is set the to the same baud rate. The serial port that talks to the serial monitor must be configured for that use, so 9600 baud (or any baud rate that the serial monitor can handle), 8 data bits, no parity and 1 stop bit. The port that talks to the light meter must be configured properly for that use, so 9600 baud, 7 data bits, even parity and 1 stop bit. You are dealing with 2 separate serial ports. Serial.println(s) //print to serial monitorĬl-200a_cs0101e_eng comms specifications.pdf (415 KB) Serial1.write(ETX) //ETX command end code Serial1.write(STX) //STX command begin code Serial.begin(9600,SERIAL_7E1) //according to the light meter manual Here is my code: byte STX = 0x02 //STX=02h But after I send the command to the light meter according to the manual (see attachment), the responses I got from the serial monitor are all strange symbol and totally unreadable. I'm trying to use Arduino Mega to read the data from the external light measurement device.
0 Comments
Leave a Reply. |