Page 1 of 1

Can a microbit detect a host computer

Posted: Sat Mar 23, 2019 1:09 pm
by rhubarbdog
Is there a way to detetmine if a microbit is connected to a laptop via usb. Is there a micropython function the microbit can run to detect a usb host

Re: Can a microbit detect a host computer

Posted: Sun Mar 24, 2019 9:43 am
by shaoziyang
I don't think so.

Re: Can a microbit detect a host computer

Posted: Mon Apr 01, 2019 8:20 am
by rhubarbdog
I was looking at some pyboard docs. There is a function in the pyb version of micropython. I'm going to raise a feature request

Re: Can a microbit detect a host computer

Posted: Sat Apr 27, 2019 11:31 am
by jimmo
I'm not aware that this would be possible to detect that USB is connected -- the USB functionality is handled by a separate chip on the micro:bit (which runs Daplink). The only pins connected between the NRF51822 (that runs your MicroPython code) is the TX/RX pair for the UART. [Ref: https://github.com/bbcmicrobit/hardware ... _V1.3B.pdf]

On the other hand, if you had something running on the host computer that detected the micro:bit then send it a message over the UART, that might work.

(Note that on the microbit, the single UART is also used by the REPL).