Serial compile error

01 Sep 2009 . Edited: 01 Sep 2009

Hi,guys.

Recently, when I new a program and copy the codes as follows:

#include "mbed.h"

DigitalOut myled(LED1);
Serial pc(9,10);

int main() {

    pc.printf("hello,this");
    while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
    }
}

Then compiled, there are errors as follows:

"No instance of constructor "mbed::Serial::Serial" matches the argument list (E289)" in file "test_s/main.cpp"
"            ^ (E0)" in file "test_s/main.cpp"
"Unable to download. Fix the reported errors..." in file "/"

What is the reason?

 

01 Sep 2009

Hi,

Take a look at http://mbed.org/forum/topic/84/

The new library updates the pins to use real names e.g. "p5" rather than just numbers

Simon