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)
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: