
In the mbed documentation LPC1768 there are many examples of serial communication implemented in a structured and disorganized way. So, I decided to make it very practical and reusable for other users who need to use this feature. For this, I created my own library based on the OO paradigm.
In the mbed documentation LPC1768 there are many examples of serial communication implemented in a structured and disorganized way. So, I decided to make it very practical and reusable for other users who need to use this feature. For this, I created my own library based on the OO paradigm.
Diff: main.cpp
- Revision:
- 0:78c623c147d2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Sep 05 22:36:20 2017 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +#include "SerialCommunication.h" + +DigitalOut myled(LED1); +SerialCommunication *serialCommunication = new SerialCommunication(p9,p10,115200); + +int main() { + int commandReceived = 0; + + while(1){ + commandReceived = serialCommunication->ReceiveCommand(); + if (commandReceived == 1){ // informação correta recebida + myled = 1; + break; + } + + } + +}