tino/pyFirmata

Code is able to upload but not working with arduino uno

RaviMeva opened this issue · 5 comments

Hello,
I wanted to turn on and off LED connected on digital pin 13 using Pyfirmata from Anaconda, spyder. The problem is no matter which digital pin I give, it is only affecting the RX LED. I have tried same connection with same logic code in arduino IDE to make sure the connection is right. It is working fine with arduino IDE not with python. I am using anaconda spyder 2.7, 64 bit on 64 bit windows 10. I am writing you the code also. Thanks.

code:
from pyfirmata import Arduino , util
import time
board = Arduino ('COM3')
iterator = util.Iterator(board)
iterator.start ()
LED_blink = board.get_pin('d:13:o') // Only RX pin is blinking, tried other pin but same result
LED_blink.write(1)
time.sleep(0.1)
LED_blink.write(0)
time.sleep(0.1)
board.exit()

I am also facing the same problem. The code is running, but only the rx light is blinking and the LED is not blinking. The board (Uno) works fine through the Arduino IDE. I am using windows 10 with python 3.6 and the latest pyfirmata through pip.

from pyfirmata import Arduino
from pyfirmata import INPUT, OUTPUT, PWM
import time

board = Arduino('COM3')

board.digital[12].mode = OUTPUT

while True:

 board.digital[12].write(1)
 time.sleep(0.5)
 board.digital[12].write(0)
 print('foo')
 time.sleep(0.5) 

I'm also getting the same issue. Has anyone found a resolution to this yet?

Wow. Can't believe I missed this. I hadn't uploaded the StandardFirmata code to the Arduino. From the Arduino sketch, I opened the example and then StandardFirmata and it's working now 👍

Thanks! deweypotts. I've got it.

@deweypotts Thanks bud....its working now!