elephantrobotics / pymycobot

This is a python API for ElephantRobotics product.
MIT License
109 stars 54 forks source link

pymycobot on windows #4

Closed kotai2003 closed 3 years ago

kotai2003 commented 3 years ago

Hi, Thanks for very nice tutorials. I would like to use myCobot python on my Windows system.

In your tutorial, declaring the usb device which is connected to myCobot as shown below. The following tutorial is based on linux system.

` from pymycobot.mycobot import MyCobot from pymycobot.genre import Angle

mycobot = MyCobot('/dev/ttyUSB0') mycobot.send_angle(Angle.J2.value, 10, 50) `

My question is that what argument I should input in as a device name in Windows system. mycobot = MyCobot('[device name]')

Thanks for very much.

zlj-zz commented 3 years ago

You can use the following code to find the port.

import serial.tools.list_ports

port_list = list(serial.tools.list_ports.comports())
for item in port_list:
    print(item[0])

In windows, the port character is usually COM*.