Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 5 months ago.
Serial com between RS485 and Leddar system
hello i am a beginner for mbed and leddar sensor. I have a very simple question, I just want to read the data get from the leddar sensor to the mbed using tera term, however there's nothing happen in tera term. This is my very simple code, is this okay to read the address?
/media/uploads/kimyong95/testing2_lpc1768_-4-.bin
- include "mbed.h"
Serial pc(USBTX,USBRX);
Serial RS485(p9,p10);
int main()
{
pc.baud(115200);
RS485.baud(11520);
RS485.putc(0x01);
while(RS485.readable())
{
pc.putc(RS485.getc());
printf("b");
}
}
1 Answer
8 years, 5 months ago.
Please use the <<code>>
tags when posting your code to keep it readable.
Your RS485 may be set to the wrong baudrate: RS485.baud(11520), probably should be 115200. Is your hardware RS485 driver Ok? Can you see any text in teraterm, print some message even before you try to read from the RS485 channel.