fetch feedback/input signal

19 Jun 2010

Hi Folks,

 

How do we get the feedback/input signal to machine ? let say without ethernet , RF or anything other than USB connectivity. Ok, let me rephrase the question again. How do you see the 'printf' (from bare-headed mbed) on machine which is connected to PC via usb port?

 

cheers,

ali

19 Jun 2010

If i understand you correctly, you want to use printf on the mbed and send it through the USB cable to a PC Computer?

If so, here is how I do it: http://mbed.org/handbook/SerialPC

11 Jul 2010

Hi Ferrdie:

Thanks for the pointer and in-fact that gave me a quite idea the way mbed is connected with host.

I am trying below example from mbed web and it works perfectly except a little glitch. I have used GNU Screen and simple ‘c’ example to talk to serial port and result is same. Every time I have to reset the board (remove and connect to usb cable again) before starting the screem or app.

Any thoughts ? seems port is locked by mbed . What is the easy tip to reset the serial port?

///////////////////////////////////////

 

Serial pc(USBTX, USBRX); // tx, rx

PwmOut led(LED1);

 

float brightness = 0.0;

 

int main() {

pc.printf("Press 'u' to turn LED1 brightness up, 'd' to turn it down\n");

 

while(1) {

char c = pc.getc();

if((c == 'u') && (brightness < 0.5)) {

brightness += 0.01;

led = brightness;

}

if((c == 'd') && (brightness > 0.0)) {

brightness -= 0.01;

led = brightness;

}

}

////////////////////////////////////////////////