Hello there! I am trying to create a simple blinking LED in python. I am using the firmata library in Arduino IDE and PyCharm to code the LED. First, I installed the firmata library in Arduino IDE and then uploaded the standard example to my Arduino Mega 2560. That worked fine, but when I switched over to pyCharm with the code below, I got the following errors.
from pyfirmata import Arduino
import time
board = Arduino('COM3')
led = board.get_pin(13)
while True:
led.write(True)
time.sleep(1)
led.write(False)
time.sleep(1)
Errors:
Traceback (most recent call last):
File "C:\Users\rajik\PycharmProjects\pineapple\mini_projects\von_mysteriouso.py", line 16, in <module>
board = Arduino('COM3')
^^^^^^^^^^^^^^^
File "C:\Users\rajik\PycharmProjects\pineapple\.venv\Lib\site-packages\pyfirmata\__init__.py", line 19, in __init__
super(Arduino, self).__init__(*args, **kwargs)
File "C:\Users\rajik\PycharmProjects\pineapple\.venv\Lib\site-packages\pyfirmata\pyfirmata.py", line 101, in __init__
self.setup_layout(layout)
File "C:\Users\rajik\PycharmProjects\pineapple\.venv\Lib\site-packages\pyfirmata\pyfirmata.py", line 157, in setup_layout
self._set_default_handlers()
File "C:\Users\rajik\PycharmProjects\pineapple\.venv\Lib\site-packages\pyfirmata\pyfirmata.py", line 161, in _set_default_handlers
self.add_cmd_handler(ANALOG_MESSAGE, self._handle_analog_message)
File "C:\Users\rajik\PycharmProjects\pineapple\.venv\Lib\site-packages\pyfirmata\pyfirmata.py", line 185, in add_cmd_handler
len_args = len(inspect.getargspec(func)[0])
^^^^^^^^^^^^^^^^^^
Is this a problem regarding how I downloaded the firmata library, or is it my code?
Thank you!!!