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.
7 years, 7 months ago.
serial communication in c++
C ++ program that sends a string LPC1768. How can I do ?
1 Answer
7 years, 7 months ago.
Using printf will send a string over serial so that it can be read in a console. The default baud rate is 9600. It is as easy as this:
#include "mbed.h" int main() { printf("Hello World\n"); }
How do you do it?
I would like to send a string through serial communication from an IDE c ++ to LPC1768
posted by 04 Aug 2017Here is an example on how to create a program on mbed's online compiler. The example also happens to be using a LPC1768 as well!
https://docs.mbed.com/docs/mbed-os-handbook/en/latest/getting_started/blinky_compiler/
posted by 04 Aug 2017I know this. I would like to send the string from DEV c ++ to the mbed LPC1768, and not using the mbed compiler.
posted by 04 Aug 2017I would like the program written in c ++ to send a string via serial communication, so then i need it for linux
posted by 04 Aug 2017Here is a list of the IDEs that are mbed supported: https://docs.mbed.com/docs/mbed-os-handbook/en/latest/dev_tools/third_party/
posted by 04 Aug 2017I may be misunderstanding what it is you exactly wanted to do. Are you trying to send strings via UART to your LPC1768, from a c++ program that is running on your computer?
posted by 04 Aug 2017What kind of things are you having problems with? Here is a blog about how to read and write from a serial port in C. Should be similar for C++.
https://stackoverflow.com/questions/6947413/how-to-open-read-and-write-from-serial-port-in-c
posted by 04 Aug 2017