x = Serial1.read (receiverPin);
Serial.println (x);
no values appeared in the serial monitor, why and how to solve this?
Seria1.read() expects no arguments or one argument that defines where to store the data. It returns either the data that is read from the serial buffer (when no arguments are supplied) OR it returns the number of bytes read.
If your device is actually sending serial data, and Serial1 is reading that data (because you have the output connected to the RX1 pin, then storing the data in receiverPin seems stupid, and printing the number of characters read is equally useless.
PaulS:
Seria1.read() expects no arguments or one argument that defines where to store the data. It returns either the data that is read from the serial buffer (when no arguments are supplied) OR it returns the number of bytes read.
If your device is actually sending serial data, and Serial1 is reading that data (because you have the output connected to the RX1 pin, then storing the data in receiverPin seems stupid, and printing the number of characters read is equally useless.
I want serial monitor to read what values that has reached my arduino
Check if the serial buffer is ready to be read (if there is data available) before you read. Use Serial1.available() . If this never returns a value greater than 0, no valid data is coming into the Rx pin.