简体   繁体   中英

Path for Windows10 Python 2.7 USB COM6

I am trying to access my USB COM6 port on my windows10 using python2.7

The original code was for Linux was:

board = MultiWii("/dev/ttyUSB0")

My modified code for Windows is:

board = MultiWii("/COM6")

Is the correct code?

No, /COM6 is not correct in Windows. Try COM6 and \\\\.\\COM6 . To write the latter one inside a string literal in Python, you probably have to escape the back slashes, so you would write "\\\\\\\\.\\\\COM6" .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM