Did you read this:
http://tutorial.cytron.com.my/2011/08/0 ... ge-finder/CASE 3 : UART READING
Maxsonar-EZ1 in UART mode are directly given an ASCII value to the microcontroller which start with an “R”, then follow by 3 value of range such as 255-inch in “2”, “5”, “5” and then lastly is the carriage return which is totally of 5 data to be received.
If (RCREG == ‘R‘) data[k=0] = RCREG;
Check if the RCREG are ASCII value ‘R’. if yes then save the data at data[0] by reset the k = 0.
if (data[0] == ‘R‘) data[k++] = RCREG;
After make sure the data[0] is ‘R’. Then next step is to save the next RCREG value in data[1], data[2], data[3] by increasing k by 1 at the time.
send_lcd_data(1,data[1]);
By referring to LCD library, by sending a 1 will toggle ON the RS of the LCD which is read as an character for LCD. Then send the ASCII data that given by the Maxsonar-EZ1 to the LCD.