MODSERIAL_example_cpp

Import libraryMODSERIAL

Bug fix release

MODSERIAL contains a simple example program to test out things are working fine. To try out MODSERIAL and use the test program, follow these step.

  1. Connect Mbed pins p9 to p10
  2. Ensure your PC/Mac/Linux host can communicate with the Mbed over the USB serial
  3. Create a new program
  4. Import the MODSERIAL library
  5. Your new programs main.cpp will look something like this:-

#include "mbed.h"

DigitalOut myled(LED1);

int main() {
    while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
    }
}

Delete this and just enter:-

#define COMPILE_EXAMPLE_CODE_MODSERIAL
#define PC_BAUD 115200
#define TX_PIN p9
#define RX_PIN p10
#include "MODSERIAL/example.cpp"

If possible, you want the PC/Mac/Linux USB serial connection to go at it's fastest speed, 115200 is good if it works.

Compile the code and down load it to the Mbed and run it.

For more information on the example program and what it does see the example source code


All wikipages