pyFirmata icon indicating copy to clipboard operation
pyFirmata copied to clipboard

Code is able to upload but not working with arduino uno

Open RaviMeva opened this issue 7 years ago • 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()

RaviMeva avatar Jun 06 '18 08:06 RaviMeva

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) 

abhijithkrishnan93 avatar Sep 25 '20 05:09 abhijithkrishnan93

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

deweypotts avatar Nov 07 '20 23:11 deweypotts

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 👍

deweypotts avatar Nov 07 '20 23:11 deweypotts

Thanks! deweypotts. I've got it.

dongtant210205 avatar Apr 19 '21 14:04 dongtant210205

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

AsthereARG avatar Dec 26 '23 03:12 AsthereARG