pyFirmata icon indicating copy to clipboard operation
pyFirmata copied to clipboard

problem with basic usage code

Open asya-schtirlitz opened this issue 6 years ago • 2 comments

Hello, I am trying to light up a LED using your basic usage code from the Readme (but I use board.digital[13], as it is the built-in LED for the Arduino Leonardo) and nothing happens. I also tried to light up LEDs connected to other digital pins. If I write a value into a digital pin and then read it, I successfully get the same value.

from pyfirmata import Arduino, util
board = Arduino('/dev/tty.usbmodem141101')
board.digital[13].write(1)

Could you give me some advice?

I am using Arduino Leonardo and MacBook (Retina, 12-inch, 2017) with macOS 10.14, pyfirmata 1.0.3 and Python 3.6.5.

asya-schtirlitz avatar Nov 03 '18 12:11 asya-schtirlitz

Have you uploaded the StandardFirmata sketch to the Arduino already? See https://github.com/firmata/arduino#usage for more information on how to do that, or if you're using the Web Editor you can find it under Examples > StandardFirmata. Once you have it, upload it to the Arduino and then you should be able to use pyFirmata to communicate with it.

brettgoss avatar Jul 28 '19 19:07 brettgoss

@tino Thank you! This should be more clear in the documentation, I skipped the StandardFirmata upload too!! Could you please edit in the Usage section of the README that the first step should be uploading the StandardFirmata to the board?

matiasandina avatar Nov 19 '19 14:11 matiasandina