Mbed Xbee USB power

02 Apr 2011

Hi,

I would like to use an external power to the mbed with vin and use the usb port as serial port and alimentation. I did the pc serial communication tutorial and I tried to do the same using an mbed. The USB of the computer was both serial port and giving power to the mbed. I would know if its possible to do the same with the mbed usb port being seiral port and serial port.

Here is code :

  1. include "mbed.h"

Serial xbee(USBTX, USBRX); DigitalOut myled(LED1);

int main() { while(1) { char c = xbee.getc(); if(c == 'a') { myled = 1; } else if (c == 'b') { myled = 0; } } }

Thank you