tino / pyFirmata

Python interface for the Firmata (http://firmata.org/) protocol. It is compliant with Firmata 2.1. Any help with updating to 2.2 is welcome. The Capability Query is implemented, but the Pin State Query feature not yet.
MIT License
576 stars 193 forks source link

problem with basic usage code #77

Open asya-schtirlitz opened 5 years ago

asya-schtirlitz commented 5 years ago

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.

brettgoss commented 5 years ago

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.

matiasandina commented 4 years ago

@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?