Skip to content

Why does the pyfirmata closes after a certain amount of time running? #113

Description

@leo-smi

I don't know the right time, but the loop just closes and no error.

I'm using arduino uno R3 (chinese clone CH340).

I think there's a problem with the threading or something like that...

The code:

from pyfirmata import Arduino, util
import time


Uno = Arduino('COM3')
pin3 = Uno.get_pin('d:3:p')

dt = 0.005
N = 255

while True:
    
    for i in range(1, N+1, 1):
        # print(i/100)
        pin3.write(i/N)
        time.sleep(dt)

    for i in range(N, 0, -1):
        # print(i/100)
        pin3.write(i/N)
        time.sleep(dt)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions