Firmata isn't working

I started using Firmata to code arduino using python to fo as project.
Unfortunately i have encounterd problems right at the begining.
At first when i tried to run Blink on firmata it worked great, but after trying more things i tried blink once again, but it didnt work, and since then nothing works.
It's important to point out that when i work on arduino software everything works properly

The code is very simple:

import pyfirmata
 import time
 
 4board = pyfirmata.Arduino('COM3')

 while True:

      board.digital[13].write(1)
      time.sleep(1)
      board.digital[13].write(0)
     time.sleep(1)
 

What might be the problem and how to fix it?

And sorry for my bad english' its not my first language.

You know indentation is structural in python?
I do not see how that script will run once with its current indentation.

The indentation is ok at the code, its just got a little messy when I copied the code to here.
In addtion, if I had done indentation error then an error will appear, right now i have bo error that appear.

Nevermind, i found my problem.
Turns out that if i run an arduino program after using Firmata, i need to run Firmata once again in order for the python filr to work.

Use

board.pass_time(1)

for your delay

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.