Disable DTR in pyserial from code

前端 未结 4 1531
無奈伤痛
無奈伤痛 2020-12-02 02:13

I\'m trying to use pyserial to send data to an arduino. But when I open the COM port it sets DTR low and resets the board. However, I have my arduino code setup such that I

4条回答
  •  孤街浪徒
    2020-12-02 02:35

    Here is a software solution, i've been using it myself for a while and it works like a charm:

    ser = serial.Serial("/dev/ttyUSB0", 115200, timeout=1)
    ser.setDTR(False)
    time.sleep(0.5)
    

    Note that the sleep is the tricky part, without it it wont work

提交回复
热议问题