how to use suspendStateChanged function to sense usb cable attachement ?

28 May 2013

I'd like to run a set-up routine if the usb cable is plugged in. Can I use the suspendStateChanged function to sense cable attachement and how? Thanks guys...

garyb

29 May 2013

Gary,

are you talking about the mbed on-board USB connector or about an USB connector that is connected to the USB D+/D- pins of the LPC1768 on the mbed?

If it is the first, see here: https://mbed.org/questions/1058/Could-the-mbed-know-if-he-is-connected-t/

If you're searching for a solution on the second option (to see if a computer is connected to bring up a virtual COM port from the LPC1768 itself) then it should be possible to use the suspendStateChanged function.

I'm in search for a working code example for the second problem myself too :-)

30 May 2013

Lieven,

Thanks for a nudge in the right direction. Either approach could work for me. Will check out that first link and see how far I get. If I stumble across anything regarding implementing the second, I will shoot you a quick post...

Gary