Hi I'm a beginner with Arduino.
I would like to use the two serial ports of the Arduino Mega for connecting ultrasonic sensors. And use another port for passing the sensor out put to another serial enabled device. If Im using RS485 protocol I can connect a number of serial enabled device to one serial port. Then how can I identify each sensors and differentiate the data comes from them?
RS485 is not a protocol, its a specification for a transmission line data link - any protocol can be used with it.
The Arduino Mega 2560 has 4 serial ports.
http://arduino.cc/en/Main/arduinoBoardMega2560
One of them is in use to upload sketches and the serial monitor.
So you have 3 ttl level serial ports which you can use.